[ 
https://issues.apache.org/jira/browse/PROTON-1820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alan Conway updated PROTON-1820:
--------------------------------
    Description: 
The Container#schedule method does not work if called from a handler function.

 

WORKAROUND: The following monkey-patch can be used to work-around the bug until 
the fix is released

 
{code:java}
require 'qpid_proton'

# Monkey-patch to fix https://issues.apache.org/jira/browse/PROTON-1820 in 
proton 0.22
# The patch will not be needed with proton >= 0.23
module Qpid::Proton

  module ContainerFix
    def run_one(task, now)
      if task == :schedule
        @lock.synchronize { @active -= 1; check_stop_lh } if maybe_panic { 
@schedule.process now }
        @lock.synchronize { @schedule_working = false }
        wake
      else
        super
      end
    end
  end

  class Container
    prepend ContainerFix
  end
end
{code}

  was:The Container#schedule method does not work if called from a handler 
function.


> [ruby] Container#schedule does not work if called from handler
> --------------------------------------------------------------
>
>                 Key: PROTON-1820
>                 URL: https://issues.apache.org/jira/browse/PROTON-1820
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: ruby-binding
>    Affects Versions: proton-c-0.22.0
>            Reporter: Alan Conway
>            Assignee: Alan Conway
>            Priority: Major
>             Fix For: proton-c-0.23.0
>
>
> The Container#schedule method does not work if called from a handler function.
>  
> WORKAROUND: The following monkey-patch can be used to work-around the bug 
> until the fix is released
>  
> {code:java}
> require 'qpid_proton'
> # Monkey-patch to fix https://issues.apache.org/jira/browse/PROTON-1820 in 
> proton 0.22
> # The patch will not be needed with proton >= 0.23
> module Qpid::Proton
>   module ContainerFix
>     def run_one(task, now)
>       if task == :schedule
>         @lock.synchronize { @active -= 1; check_stop_lh } if maybe_panic { 
> @schedule.process now }
>         @lock.synchronize { @schedule_working = false }
>         wake
>       else
>         super
>       end
>     end
>   end
>   class Container
>     prepend ContainerFix
>   end
> end
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to