On Sun, Jun 1, 2014 at 9:39 AM, Marcus Ottosson <[email protected]> wrote:
> I think both ways work great > > Aw, that’s no good. :) I’m looking for actual cases where one is more > appropriate than the other, not which one is the silver bullet of computing. > > It’s a discussion on distributing work via a chat-like interface, not very > generalised I’d think, but if you’d like let’s throw in some numbers: > > In the conversation, there’d be around: > > - 500 peers in total > - 50 of them being active within any given second > - within which 2 tasks are being distributed continually > - Tasks are at the size of “hello world”, “create directory”, “list > directory”, “write metadata”, “add 1 to 1” etc.. > - ..each taking up a maximum of 1 second each. > > Personally I would prefer not to talk in terms of "patterns" as that sounds very java-minded (command pattern, actor pattern, ...), and boxing you into thinking about what you can and cannot do. I see RPC as just a formalized layer of message passing. Under the hood you have a socket sending a message, and someone on the other side receiving the message, and sending a reply. The difference is that RPC puts you firmly into a request-reply situation, where the reply may not even be for the computed answer. The reply could just be an id for which the caller could use as a promise to then poll for the computed result at a later date. Using a pure message passing framework like ZeroMQ, as you already know, gives you the tools to implement more communication types like push-pull, and pub-sub. If these types of communication are important to your application, then RPC is probably not the single solution. It can definitely be used for a client to talk to a server, and then a server can use features of zmq to talk to workers. But in terms of the client talking to the server, I would see RPC or lower level message passing being pretty much the same camp. Either you are directly sending the structured message, or you are using a predefined interface that will send your message based on parameters. Either you want to wait for the answer or you don't. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2SdTHud6bCeipDSScTkUei-MpEz3uXJOC1AX94Z2Kadg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
