Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Eliminate usage of use_mailbox

  • Loading branch information...
commit f5d1265601691d8322bf845d4b521311e1a8c4c1 1 parent 5b33931
@tarcieri tarcieri authored
Showing with 14 additions and 1 deletion.
  1. +2 −1  lib/celluloid/zmq.rb
  2. +12 −0 lib/celluloid/zmq/mailbox.rb
View
3  lib/celluloid/zmq.rb
@@ -1,6 +1,7 @@
require 'ffi-rzmq'
require 'celluloid/io'
+require 'celluloid/zmq/mailbox'
require 'celluloid/zmq/reactor'
require 'celluloid/zmq/sockets'
require 'celluloid/zmq/version'
@@ -15,7 +16,7 @@ class << self
# Included hook to pull in Celluloid
def included(klass)
klass.send :include, ::Celluloid
- klass.use_mailbox { Celluloid::IO::Mailbox.new ZMQ::Reactor.new }
+ klass.mailbox_class Celluloid::ZMQ::Mailbox
end
# Obtain a 0MQ context (or lazily initialize it)
View
12 lib/celluloid/zmq/mailbox.rb
@@ -0,0 +1,12 @@
+require 'celluloid/io'
+
+module Celluloid
+ module ZMQ
+ # Replacement mailbox for Celluloid::ZMQ actors
+ class Mailbox < Celluloid::IO::Mailbox
+ def initialize
+ super Celluloid::ZMQ::Reactor.new
+ end
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.