pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Cross-thread messaging (was: Heads Up - new Pivot Article)
Date Tue, 28 Sep 2010 17:23:22 GMT
After giving this some thought, I don't think MessageBus is the right solution here. When a
message is sent, the handlers are all called on the thread that sends the message. You could
probably get something working with this approach, but it might not be the best way.

Why not just use the native monitor support provided by the platform for this? Start up a
plain old thread as your headless app, and have it wait() on some object. Your main app can
call notify() on the object as needed to wake up the thread, and the thread can then examine
the state of the object to determine how to proceed.

Would that work?


On Sep 28, 2010, at 11:14 AM, B.L. Zeebub wrote:

> 
> 
> Greg Brown wrote:
>> 
>> OK. I had assumed that you were launching a separate process via
>> Runtime.exec(). Is "ClientTask" what you are referring to as your headless
>> app? If so, then yes - it is running in the same JVM as the UI, just on a
>> background thread.
>> 
>> The messaging API doesn't currently support cross-thread messaging, but I
>> think we could pretty easily update it to do so. Let me look into that.
>> 
> 
> Yes, the clientTask is the headless app.
> 
> Regards
> 
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Heads-Up-new-Pivot-Article-tp1535411p1596592.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Mime
View raw message