The 2.0 spec moved to dissolve this peers concept, but you can achieve
the same thing by having a doubling up on both traditional "peers",
where each acts as a server and client, though not over the same
immediate pipe I would imagine, but the transport would be up to you
anyway, so it could be.
I can't speak for jabsorb, but I'd check with them directly. In my
experience, many 1.0 implementations never had the bi-directional
concept working correctly. I wouldn't take wikipedia's description as
the fact of what json-rpc is (or was). I always read the 1.0 spec as
being a client and server, that act could act as peers. Not sets of
peers where the messages could go from A->B->C and back directly.
> I cannot find any documentation, example or tutorial how to achieve
> bidirectional communication beyond the simple callback mechanism. What
> I need is a setup, such that all clients that are connected to one
> server, are notified when any of the clients performs certain actions
> on the server.
What you are talking about is more like a central notification hub,
not many 'peered' relationships. I guess it depends if an event on one
client needs to trickle back to the central server, then out to
another client... a message broker and agents. An event based system
using json-rpc notifications does this very well, but you can also do
it without confirmed, but simple responses. Message passing, more than
rpc...
It depends on your transport (http or sockets)? Are your client's
browsers or smarter clients? JSON-RPC can help you do these types of
things, but you are correct that you need an implementation that would
support the long polling/open connections, and an API designed to
handle this message passing setup.
If you need one client to call functions on another, a meta-json-rpc
set of exposed methods on the central server that take json-rpc
messages a parameter to be passed to clients would also work. Depends
how smart/involved you want your central server I suppose. Also if it
is a spoke, or a wheel... server could just arrange initial contacts..
> Can you outline a better possibility how to achieve bidirectional
> communication in the scenario I have mentioned?
JSON-RPC doesn't have a set way to handle something like this, so you
may end up rolling your own. If you want to post more examples in this
conversation, I'm sure there are folks who could offer suggestions,
but I haven't seen many implementations doing this.
--
Matt (MPCM)