Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Style - how to give class method call as parameter

by strat (Canon)
on Jun 26, 2012 at 18:23 UTC ( #978478=note: print w/replies, xml ) Need Help??


in reply to Re: Style - how to give class method call as parameter
in thread Style - how to give class method call as parameter

Well, I reply to Corion's posting although it becomes a general reply to all who replied ;-)

Thank you very much for your replies. I hoped for a beautiful way to write this, but I will use version 3 since it looks less ugly than the other two ways.

Adding a timeout-parameter to extend_order_lease would be best. But I don't dare to change the external framework or Boldra would look at me with very sad eyes the whole day long ;-)

The synthetic sugar with the prototype looks nice, but in my case I don't want to use it. I put the methods do_sub_with_timeout or do_method_with_timeout into a Moose role so we can be use them everywhere in our framework (in the moment in about 4 different classes), and so I want them to be methods and not subs for not to need import subs into a foreign namespace. (And methods ignore prototypes anyway.)

Have a nice evening

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

  • Comment on Re^2: Style - how to give class method call as parameter

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://978478]
help
Chatterbox?
[ambrus]: I think the minimal implementation here is just a timer and io function, plus pushing to the @REGISTRY.
[Corion]: ambrus: Yeah, at least that's what I think I'll start with. A timer and potentially the dummy IO function that never is ready
[ambrus]: That only lets you invoke the main loop from Prima->run;, not from AnyEvent->condvar- >recv; but that shouldn't matter
[Corion]: ambrus: Details ;)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2016-12-08 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (141 votes). Check out past polls.