Any design pattern that will be helpful in implementing asynchronous communication using sockets? -
Here's a brief description of what I want to accomplish.
I want to develop a colleague using the socket application I want all my communication to be asynchronous. Whenever a coworker asks another coworker, he will be sent a request tagged with a specific ID. He will also store this information about what he should do, in which he gets the answer back with that ID which he has sent now. The request that receives this request will either execute the request or send it to one of his colleagues who think he will be able to execute it. Now the last coworker, who will actually execute this request, will send that reaction directly to the person who started this request.
Other design options are available such as start a new thread for every request or use call back with threads, but I want to use simple message passgun plan with sockets.
Is there a good design pattern that I can work on? Either send a request, forget about it or start some work and then when I get the answer to my request then I should know what to do next. I can send this information, i.e. what to do next, embedded in the object or I can store the msg ID as the key in the hash table.
Any good design that you can come up with?
Pattern (PDF by Schmidt has also been told about this Wikipedia article) is most of the work Strong for your question, especially of your monumental chain.
Comments
Post a Comment