On Fri, Jun 1, 2012 at 9:26 PM, catshow <[email protected]> wrote:
> Thanks for the quick feedback.
>
> The XPC Module would be receiving messages in a Grand Central Dispatch
> serial queue that I create, so it would NOT be receiving them in the
> same thread as node/v8 is running.
>
> So I guess that I would have to use the uv_async_send().  Is that well
> documented?  I haven't looked yet.

libuv as such doesn't have its semantics documented. On the other
hand libev does, and since libuv is just libev on Unix, you can read up
on ev_async_send and friends.
>
> My idea is that I want to push messages from my mac app to a node.js
> app running in an XPC module.
>
> I would also like to respond to the original XPC message, and be able
> to send messages to another XPC module from the javascript code.  So I
> would need to be able to create an XPC_Object and then dispatch the
> message out.

I think you'll need async_send to 'transfer' events between the loops.
Of the top of my head I don't know other solutions
>
> In your code you have an AsyncResolverBaton, is that a nodejs class,
> or is that your creation?  It looks like the baton.request.data is
> just a void pointer to a c object, so I could probably pass the
> xpc_object with that.  Would that be a safe assumption?

That is a custom structure wrapping the uv_async_t.
See https://github.com/nikhilm/jsfoo-pune-2012
slides.pdf page 28 onwards and the 'async' folder for sample code.

Regards,
Nikhil

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to