A few things I am still thinking about.
TTL services
I want to provide TTL services (i.e. give a message a certain time in hops to live). I can see three ways:
- Build it in to Net::Distributed.
Makes life easier, but adds weight to the core, which may not be necessary for most people.
- Subclass Net::Distributed and change send_message to
reduce ttl by one, and not send if it is 0.
Simple, but has the problem of "branching subclasses". If I want to subclass Net::Distributed, and the subclass may also want to use TTL (or not), then I will have to write two subclasses with alternative parents.
- Provide a handler which reduces TTL by one and returns true (allowing other handlers to handle the message) unless TTL is 0.Elegant, but means that messages get sent for one more hop than is necessary, because they are ignored at the final hop.
Any ideas would be welcome.
Handler exports
Handlers export methods by default. This is a bit naughty, but quite helpful. However, what if I want to override an existing method (e.g. a handler which wants to use internal_processing to do something)? Should the main internal_processing method automatically call hooks to the handlers? Or...?
Watch this space for Net::Distributed::Space... although I am a bit discouraged by the response so far. I get more replies for my dumb questions!
dave hj~
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.