Sha256: 666d57eed56beb7ccf57b808de398de2aa2246bcc0e572363ddc065adffd7cff
Contents?: true
Size: 782 Bytes
Versions: 3
Compression:
Stored size: 782 Bytes
Contents
module Buster class Host def initialize(routes, context, local_endpoint = nil) @local_endpoint = local_endpoint ||"inproc://local_endpoint" @context = context @router = Buster::Router.new(@context, routes) @poller = Buster::Poller.new end def start frontend = @context.socket(ZMQ::ROUTER) frontend.bind(@local_endpoint) backend = @context.socket(ZMQ::DEALER) backend.bind("inproc://workers") @router.connect_routes backend, @poller Buster::Worker.start_worker @context @poller.pipe frontend, backend @poller.pipe backend, frontend poll_thread = Thread.new { @poller.start } poll_thread.join @context.terminate end def stop @poller.stop end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
buster-0.1.3 | lib/buster/host.rb |
buster-0.1.2 | lib/buster/host.rb |
buster-0.1.1 | lib/buster/host.rb |