tedeh/jayson — pull request #35 by ecksun (2014-12-17 18:04:22+00:00)
Title: Feature/handle server notifications

I'm using JSON-RPC version 1 for commnicating with an embedded device over USB-serial. One ability we need for that is to be able to send notifications from the server (the embedded device) to the client.

There is support for notifications from the server to the client in JSON-RPC 1, the two endpoints are more peers than actual client/server.

a58d7d5 contains most of what is interesting for the actual client support, I also tried to change the tcp client to take advantage of this new functionallity. In order to do so I had to keep connections open indefinitly (instead of closing them right away) and actually make sure the reponses we are getting actually corresponds to an outstanding request.

I created this pull request mostly to start a discussion on how to approach the problem, I'm not convinced I like the way I did the tcp client implementation as it is breaks backwards compability. Perhaps adding an option for this behaviour is the right way forward?