Designing an API for the client to a 3rd-party service

Viewed 706

I am fairly new to Scala and I'm working on an application (library) which is a client to a 3rd-party service (I'm not able to modify the server side and it uses custom binary protocol). I use Netty for networking.

I want to design an API which should allow users to:

  • Send requests to the server
  • Send requests to the server and get the response asynchronously
  • Subscribe to events triggered by the server (having multiple asynchronous event handlers which should be able to send requests as well)

I am not sure how should I design it. Exploring Scala, I stumble upon a bunch of information about Actor model, but I am not sure if it can be applied there and if it can, how.

I'd like to get some recommendations on the way I should take.

3 Answers
Related