[Vortex] doc+api comments on vortex_connection_new and vortex_channel_new

Francis Brosnan Blazquez francis at aspl.es
Tue Oct 31 08:30:09 CET 2006


El lun, 30-10-2006 a las 08:28 +0100, Francis Brosnan Blazquez escribió:

Hi all,

> > API comment:
> > 
> > VortexOnCloseChannel ... must return true/false, so is not so useful
> > if you have to post it's result to a new thread, where the decision
> to
> > allow close or not will be made.
> > 
> > Can it NOT return? Will that block other threads?
> 
> No, it can't. Currently, close channel notification is done in a way
> that it requires the handler provided by the user
> (VortexOnCloseChannel)
> to return with the reply. If it doesn't returns, it will block the
> thread running that handler, causing a problem if several close
> request
> are received.
> 
> Maybe, the close handling could be splitted into the notification
> piece
> and the reply piece, allowing the user space to get a close
> notification
> and just return, and then the user space must call to notify its
> intention about closing the channel or not. Are you looking for
> something like this or I missing something?

About this issue, to return or not return from the close handler. 

It has been updated the close request internals to be handled in two
ways. 

The first one, which is already known, must *always* return true or
false once received the notification, making nearly impossible to
contact other thread to get such reply. The callback notified must
return a decision on site.

And second one, based on the following new API, which allows to defer
close reply:

  - VortexOnNotifyCloseChannel (handler)
  - vortex_channel_set_close_notify_handler
  - vortex_channel_notify_close

..which allows to get a notification that a close request has arrived,
but not required to do any operation at that point, and later, the close
request is accepted or rejected calling to vortex_channel_notify_close
with the proper value, from any thread. In short, allows to decouple
close notification from its management.

This will be included in the next 0.9.1 vortex release, however it is
already available at the vortex SVN.

Cheers!

-- 
Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.




More information about the Vortex mailing list