cztop-reactor 0.8.0
This is an implementation of the Reactor pattern described in [Pattern-Oriented Software Architecture (Volume 2)][POSA2]. It allows an asynchronous application to be described as one or more "reactions" to events, in this case either I/O conditions on a ZMQ socket or a timer expiring. A simple example: # Start a SERVER socket, and print out any messages sent to it reactor = CZTop::Reactor.new socket = CZTop::Socket::SERVER.new socket.bind( 'tcp://0.0.0.0:8' ) reactor.register( socket, :read ) do |event| if event.readable? message = event.socket.receive puts "Read: %p" % [ message.to_a ] end end reactor.start_polling
Gemfile:
=
installation:
=
Dépendances de Runtime (3):
Dépendances de Development (7):
hoe
~> 3.17
hoe-deveiate
~> 0.10
hoe-highline
~> 0.2
hoe-mercurial
~> 1.4
rdoc
>= 4.0, < 7
rdoc-generator-fivefish
~> 0.3
simplecov
~> 0.13