Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

Replies are listed 'Best First'.
Re: Way to monitor message queue
by rcaputo (Chaplain) on Aug 05, 2009 at 05:40 UTC
Re: Way to monitor message queue
by Your Mother (Bishop) on Aug 05, 2009 at 05:28 UTC

    You might/probably want to look at POE.

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?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-12-15 14:30 GMT
Find Nodes?
    Voting Booth?
    How many stories does it take before you've heard them all?

    Results (69 votes). Check out past polls.