Problem with AESend()
Problem with AESend()
- Subject: Problem with AESend()
- From: "Patrick M" <email@hidden>
- Date: Wed, 11 Apr 2007 17:38:43 -0400
Hi, I have a problem using (correctly apparently) Apple Events.
The scenario:
I have an application (which we will call AppA) that does 'stuff'.
I also have a menu bar item (that lives in SystemUIServer... which we will
call AppB) that polls AppA for it's status using Apple Events (AESend,
infinite timeout, waiting for reply) and displays it with a fancy icon.
I have seen some threads on AESend blocking for certain things, but nothing
conclusive with respect to my situation.
Before anyone tells me a better way to do this, I already know,
unfortunately I am unable to do it properly, i need to work with what i
have.
AppB uses a timer to poll AppA, once every second. If AppA is busy, say
processing an event to open a document (which AppA does indeed do), the next
time AppB sends AppA a message, while AppA is still processing the event to
open a document, it hangs. Also, once AppA is done opening the document, I
had assumed that the message AppB sent was queued and would get to the front
of the queue in time, but it seems to never do that. Even after AppA
becomes idle, AppB continues to hang on AESend, no error is returned!!!!!!!!
I have heard that the queue size is set at 5, and that means things pile up
really fast, but if that is the case, why would the message sent from AppB
not fail at some point (note i have used the wait forever option)? if it is
in the queue, it should get to it eventually, and if the queue was full when
it tried, why is an error not returned?
I _have_ been able to get around all this implementing my own queue of
events (with threads waiting on one semaphore) , but this seems dumb since
the OS should be doing this for me. I don't want to reimplement the event
queue.
I would like a definitive answer as to why AppB hangs as it does and what
can i do within the guidelines of AESend to not hang when the receiving
process is busy.
Someone asked about increasing the queue size, but no one answered. Is this
possible? Really one would expect AESend to return with an error if the
queue is full, why is this not so? also, any other documentation about the
queue behaviour/size would be appreciated.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden