lib/dripdrop/node.rb in dripdrop-0.9.6 vs lib/dripdrop/node.rb in dripdrop-0.9.8
- old
+ new
@@ -136,20 +136,20 @@
#
# nodelet :heartbeat, SpecialNodelet
#
# If you specify a block, Nodelet#action will be ignored and the block
# will be run
- def nodelet(name,klass=Nodelet,&block)
- nlet = @nodelets[name] ||= klass.new(self,name,routing)
+ def nodelet(name,klass=Nodelet,*configure_args,&block)
+ nlet = @nodelets[name] ||= klass.new(self,name,*configure_args)
if block
block.call(nlet)
else
nlet.action
end
nlet
end
-
+
# Creates a ZMQ::SUB type socket. Can only receive messages via +on_recv+.
# zmq_subscribe sockets have a +topic_filter+ option, which restricts which
# messages they can receive. It takes a regexp as an option.
def zmq_subscribe(address,socket_ctype,opts={},&block)
zmq_handler(DripDrop::ZMQSubHandler,ZMQ::SUB,address,socket_ctype,opts)
@@ -267,10 +267,11 @@
return false unless @recipients_for[dest]
@recipients_for[dest].delete(identifier)
end
# Catch all error handler
- def error_handler(e)
+ # Global to all DripDrop Nodes
+ def self.error_handler(e)
$stderr.write "#{e.class}: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
end
private