[SR-Users] async processing in a module

Matthew Williams mgwilliams at gmail.com
Fri Jun 24 13:00:13 CEST 2011


Hi,

I'm working on a jsonrpc (client) module that we would like to make async,
using t_suspend and t_continue from the tm module. I have a couple questions
related to this.

The way I understand these functions, t_suspend will freeze the transaction
in shared memory and immediately return and t_continue will unfreeze the
transaction. What I'm not clear on here is whether t_continue will continue
processing of the transaction within the process that calls t_continue, or
will it delegate to a worker process?

I assume I should spawn an io process in child_init which will be
responsible for sending/receiving on the socket(s), but what is the best way
to communicate between processes? Is there a way to get a fd from
fork_process (that can be written to by any child and read from using
select() in the io thread)?

This is my first attempt at a real module, so any pointers are greatly
appreciated.

Regards,
Matthew WIlliams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110624/18b379de/attachment.htm>


More information about the sr-users mailing list