Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Way to monitor message queue

by nagalenoj (Friar)
on Aug 05, 2009 at 05:10 UTC ( #785971=perlquestion: print w/ replies, xml ) Need Help??
nagalenoj has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

Is it possible to watch message queue for a new message?

We can do this by having a loop and a sleep inside it and check for new messages in the message queue. But, I feel this is not a worthy solution. If no messages are coming then it is of no use to check every time after sleep.

Is there any other way to accomplish this task? similar to select function for sockets

Comment on Way to monitor message queue
Re: Way to monitor message queue
by Your Mother (Canon) on Aug 05, 2009 at 05:28 UTC

    You might/probably want to look at POE.

Re: Way to monitor message queue
by rcaputo (Chaplain) on Aug 05, 2009 at 05:40 UTC
Re: Way to monitor message queue
by BrowserUk (Pope) on Aug 05, 2009 at 06:21 UTC

    What kind of message queue? Tk, Wx, WinNative, Other?

    Any solution offered without knowledge of the type of message queue is just pointless speculation!


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      I am referring to Unix IPC message queues, which is a way to send a block of data from one process to another.

Re: Way to monitor message queue
by cdarke (Prior) on Aug 05, 2009 at 08:04 UTC
    msgrcv should block waiting for a message unless IPC_NOWAIT is set in the flags.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://785971]
Approved by vinoth.ree
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-12-21 07:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls