mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Use latest Celluloid with thread tasks
This commit is contained in:
parent
3a29555553
commit
25df7abbee
3 changed files with 14 additions and 17 deletions
2
Gemfile
2
Gemfile
|
@ -1,7 +1,7 @@
|
|||
source 'http://rubygems.org'
|
||||
gemspec
|
||||
|
||||
gem 'celluloid'
|
||||
gem 'celluloid', ">= 0.12.0.pre"
|
||||
gem 'slim'
|
||||
gem 'sprockets'
|
||||
gem 'sass'
|
||||
|
|
|
@ -15,6 +15,8 @@ module Sidekiq
|
|||
include Util
|
||||
include Celluloid
|
||||
|
||||
# exclusive :process
|
||||
|
||||
def self.default_middleware
|
||||
Middleware::Chain.new do |m|
|
||||
m.add Middleware::Server::Logging
|
||||
|
@ -29,10 +31,6 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def process(msgstr, queue)
|
||||
# Defer worker execution to Celluloid's thread pool since all actor
|
||||
# invocations are run within a Fiber, which dramatically limits
|
||||
# our stack size.
|
||||
defer do
|
||||
begin
|
||||
msg = Sidekiq.load_json(msgstr)
|
||||
klass = constantize(msg['class'])
|
||||
|
@ -47,7 +45,6 @@ module Sidekiq
|
|||
handle_exception(ex, msg || { :message => msgstr })
|
||||
raise
|
||||
end
|
||||
end
|
||||
@boss.processor_done!(current_actor)
|
||||
end
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|||
gem.add_dependency 'redis', '~> 3'
|
||||
gem.add_dependency 'redis-namespace'
|
||||
gem.add_dependency 'connection_pool', '~> 0.9.2'
|
||||
gem.add_dependency 'celluloid', '~> 0.11.1'
|
||||
gem.add_dependency 'celluloid'
|
||||
gem.add_dependency 'multi_json', '~> 1'
|
||||
gem.add_development_dependency 'minitest', '~> 3'
|
||||
gem.add_development_dependency 'sinatra'
|
||||
|
|
Loading…
Add table
Reference in a new issue