RubyGems Navigation menu

cztop-reactor 0.7.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

Versions:

  1. 0.7.0 - July 24, 2018 (22 KB)
  2. 0.6.0 - July 23, 2018 (22 KB)
  3. 0.5.0 - July 11, 2018 (21 KB)
  4. 0.4.0 - June 27, 2018 (20.5 KB)
  5. 0.3.0 - May 16, 2017 (20.5 KB)
Show all versions (10 total)

Authors:

  • Michael Granger

Owners:

SHA 256 checksum:

0087758a50f1d90bec27c9771868c0dad141cc220062c2ff52bf825569559bdc

Total downloads 3,517

For this version 468

Gemfile:
= Copy to clipboard Copied!

install:
=

License:

ISC

Required Ruby Version: >= 2.2.4

Links: