Hi all,
I’m developing an example program to illustrate the benefits and
disadvantages of a service-oriented approach to task-distribution;
mimicking the instant message-approach to routing messages from one-to-many
via a central broker, it’s not quite at the point where pros and cons start
showing their true colors, but getting there.
First question - Routing multiple inputs to a single output
peer.py represents a running client capable of making requests to the
server, or swarm.py. Both peer.py and swarm.py handles incoming
requests/replies via rather long-winded if/else methods:
# Incoming messagesif type == 'letter':
# do stuff
elif type == 'service':
# do stuff
elif type == 'receipt':
...
What would be a better/neater approach to routing multiple inputs to a
single output, in cases where there’d be a large number (50+) of branches
in logic?
Go to method
<https://github.com/abstractfactory/labs/tree/master/python/messaging/chat>
Best,
Marcus
--
*Marcus Ottosson*
[email protected]
--
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/CAFRtmODUGwFEJDmR0qYEm1YHptPR-%2Ba-4dP_cFDEOWcfF__n3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.