mirror of
https://github.com/valitydev/elixir-thrift.git
synced 2024-11-06 02:05:16 +00:00
.. | ||
config | ||
lib/calculator | ||
test | ||
thrift | ||
mix.exs | ||
README.md |
Example
The example/
directory of elixir-thrift contains an implementation of a simple calculator service. It serves two purposes:
- How to use this library.
- 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.