Building the Other Side of the Broker – The Service

Ringmaster

Today has been spent putting together the design and initial coding of the other side of the broker - the service. Now that I've got the client working, and working pretty well, actually, it's time to be able to offer up data to the clients by becoming a service. There's really nothing new here - other than I can't control the multiplexing of the different requests. They are all going to come into one socket and that's controlled by the Broker. If I want to have multiple socket connections to the Broker, then I can split up the load, but I have no real control over the multiplexing. So I have to account for that in the design.

The problem with the design of the service is that there are two kinds of services I'd like to have, and they really need totally different ways of interacting with them. For one use case, I'd like to just give something a value and a name to publish it under. The service will then take this value (as a pointer or reference) and talk to the Broker, register this name, handle all the requests, and when and if I happen to change the value, it will send updates to those clients registered to receive updates.

The second one is more conversational in nature. This time, I'd like to be able to handle all the interaction with the clients. It's much more client-specific as we have to keep track of the state of the conversation with each client, but it allows me the greatest flexibility, and I have need of this guy as soon as I can write it.

So it's been a day of writing headers, working out the details, thinking again, fixing up the headers, and then, when it all seems solid, starting to implement the first class.