Skip to content

Latest commit

 

History

History

example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Example

The example/ directory of elixir-thrift contains an implementation of a simple calculator service. It serves two purposes:

  1. How to use this library.
  2. Example of what elixir-thrift generated code looks like.

Calculator Service

The service is very simple, and implements the four basic arithmetic operations: addition, subtraction, multiplication, and division. It demonstrates how to add a Thrift server to a supervision tree, and how to write a handler for a service defined in Thrift. It also demonstrates how to use exceptions by implementing a division-by-zero exception.

For client usage, you should consult the test cases to see how to make requests to a Thrift service.