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~