Class that cleanly abstracts away the different remote participants in ruote and allows daemon writers to just worry about processing workitems without worrying over the transport mechanism or anything else...
Configure this daemon as a remote participant to ruote.
# File lib/daemon_kit/ruote_participants.rb, line 10 def configure(&block) instance.configure(&block) end
# File lib/daemon_kit/ruote_participants.rb, line 22 def instance @instance ||= new end
Yields self and configures the remote participants
# File lib/daemon_kit/ruote_participants.rb, line 43 def configure(&block) block.call( self ) @transports.freeze @participants.freeze end
Register classes as pseudo-participants. Two styles of registration are supported:
register( Foo ) register( 'short', ShortParticipant )
The first format uses the class name (downcased and underscored) as the key for identifying the pseudo-participant, the second uses the the provided key.
Pseudo-participant classes are instantiated when registered, and the instances are re-used.
# File lib/daemon_kit/ruote_participants.rb, line 68 def register( *args ) key, klass = if args.size == 1 [ underscore( args.first.to_s ), args.first ] else [ args[0].to_s, args[1] ] end @participants[ key ] = klass.new end
Generated with the Darkfish Rdoc Generator 2.