Closed karalabe closed 10 years ago
Random thought, if I add a new state to the client, designating connected but not accepting, with an explicit Start call required to get inbound messages, maybe it would solve this. But I'm not quite sure yet. I'll hack a bit on RegionRank and see what is truly needed and what is only superficial.
For now, Iris supports separate service and client connections. This may make the issue smaller. As to the explicit starting (or implicit with the new init method in the binding ServiceHandler callbacks), I'm not sure it's a good idea, since it would be a race condition anyway since any initialization could become stale by the time the service registration completes. The only viable way would be to accept "service updates" but not "service requests", which would either extremely over-complicate things if implemented within a single connection, or we need two concurrent service registrations. For now, the second should be the chosen solution.
[Memo to self]
An Iris client should support some form of messaging calls (typically requests) without registering as a service. The main usage would be initializing the service before accepting inbound messages.
A current hack could be to join as a temporary app group, initialize and then join as the service itself. Yep, ugly.