[ 
https://issues.apache.org/jira/browse/PROTON-752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14223253#comment-14223253
 ] 

ASF subversion and git services commented on PROTON-752:
--------------------------------------------------------

Commit 0820a3722b6ab5c2a5a4dbfac3428de7d22c1c6e in qpid-proton's branch 
refs/heads/master from [~mcpierce]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=0820a37 ]

PROTON-752: Provide a non-blocking means to receive messages in Ruby.

To avoid changing the APIs or their intentions, a new class method is
added:

  Qpid::Proton::Receiver::receive_and_call

The method takes as arguments either an existing instance of Messenger
or else the parameters to create an instance, and also a code block to
be called with each message received.

The messenger is then put into passive mode and a new thread started. It
then monitors the messenger and, when a new message is received, passes
it to the block for processing.

To exit the messenger, the code would call Messenger#interrupt. The
thread then exits and the messenger stops processing.


> Ruby: Cproton calls don't unlock the GIL for blocking / long-running 
> operations
> -------------------------------------------------------------------------------
>
>                 Key: PROTON-752
>                 URL: https://issues.apache.org/jira/browse/PROTON-752
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: ruby-binding
>    Affects Versions: 0.8
>            Reporter: Dominic Evans
>            Assignee: Darryl L. Pierce
>            Priority: Minor
>
> Currently the I/O-style calls to the Cproton methods don't unlock the Ruby 
> GIL, impacting performance as other Threads could be given time on the 
> interpreter whilst the extension code is running. 
> Depending on Ruby version this is simply a matter of wrapping the calls in 
> rb_thread_call_without_gvl (Ruby 2.x +) or rb_thread_blocking_region (Ruby 
> 1.9.x). On Ruby 1.8 I'm not sure if you can enable this, but its my 
> understanding that RHEL requires continued support for 1.8, so some #define 
> work would be needed to perform a no-op on that version.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to