edgurgel / bertrpcex

A pool of BERT-RPC clients built on top of poolboy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

BERT-RPC Elixir client

A pool of BERT-RPC clients

Implementation

bertrpcex uses poolboy to have pools of workers that connect/encode/decode BERT-RPC.

The configuration is done directly on each pool, this is part of the .app (as example):

env: [
  pools: [
    { [:ext, :nat],
      [size: 10, max_overflow: 20],
      [host: {127,0,0,1}, port: 8000]
    }
  ]
]

This configuration means:

Module ext and nat are hosted at 127.0.0.1 at 8000 on pools of size 10 and max_overflow 20 each

Usage:

Let's suppose that ext has a binary method named... binary.

response = BertrpcEx.call(:ext, :binary, [1,2]).

This will pick a worker, execute the call and return the expected response.

That's it.

TODO

Write tests!

Contributing

If you'd like to hack on Bertrpc.ex, start by forking my repo on Github.

You need Elixir and Erlang R16.

Dependencies can be fetched running:

$ mix deps.get

To compile:

$ mix compile

Pull requests are greatly appreciated.

About

A pool of BERT-RPC clients built on top of poolboy

License:MIT License


Languages

Language:Elixir 100.0%