1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Remove defer support, required for large execution stacks on Ruby 1.9

This commit is contained in:
Mike Perham 2014-02-01 20:49:42 -08:00
parent cd0fee8143
commit 25147c6653

View file

@ -34,7 +34,6 @@ module Sidekiq
msgstr = work.message msgstr = work.message
queue = work.queue_name queue = work.queue_name
do_defer do
@boss.async.real_thread(proxy_id, Thread.current) @boss.async.real_thread(proxy_id, Thread.current)
ack = true ack = true
@ -60,7 +59,6 @@ module Sidekiq
ensure ensure
work.acknowledge if ack work.acknowledge if ack
end end
end
@boss.async.processor_done(current_actor) @boss.async.processor_done(current_actor)
end end
@ -71,22 +69,6 @@ module Sidekiq
private private
# We use Celluloid's defer to workaround tiny little
# Fiber stacks (4kb!) in MRI 1.9.
#
# For some reason, Celluloid's thread dispatch, TaskThread,
# is unstable under heavy concurrency but TaskFiber has proven
# itself stable.
NEED_DEFER = (RUBY_ENGINE == 'ruby' && RUBY_VERSION < '2.0.0')
def do_defer(&block)
if NEED_DEFER
defer(&block)
else
yield
end
end
def identity def identity
@str ||= "#{hostname}:#{process_id}-#{Thread.current.object_id}:default" @str ||= "#{hostname}:#{process_id}-#{Thread.current.object_id}:default"
end end