elixir-thrift/example
2021-05-07 02:09:28 +05:30
..
config Add an example project (#412) 2018-08-28 17:12:45 -07:00
lib/calculator replace System.stacktrace/0 with __STACKTRACE__ 2021-05-07 02:09:28 +05:30
test Add an example project (#412) 2018-08-28 17:12:45 -07:00
thrift Add an example project (#412) 2018-08-28 17:12:45 -07:00
mix.exs Add an example project (#412) 2018-08-28 17:12:45 -07:00
README.md Fix the example/ directory link (#416) 2018-08-31 20:19:35 -07:00

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.