2 # = Light Weight Event System bindings for Ruby
6 # # create an Emitter which may be used for the lifetime of your process
7 # emitter = LWES::Emitter.new(:address => '224.1.1.11',
9 # :heartbeat => 30, # nil to disable
10 # :ttl => 1) # nil for default TTL(3)
12 # # parse your ESF file at startup, the example below assumes you
13 # # have "Event1" and "Event2" defined in your ESF file:
14 # type_db = LWES::TypeDB.new("my_events.esf")
16 # # create classes to use, by default and to encourage DRY-ness,
17 # # we map each event in the ESF file to a class
18 # # Optionally, you may specify :parent => module/namespace
19 # type_db.create_classes! :parent => MyApp
21 # # inside your application, you may now do this to slowly build up
22 # # fields for the event
23 # my_event = MyApp::Event1.new
24 # my_event.started = Time.now.to_i
25 # my_event.remote_addr = "192.168.0.1"
26 # # ...do a lot of stuff here in between...
27 # my_event.field1 = value1
28 # my_event.field2 = value2
29 # my_event.field3 = value3
30 # my_event.finished = Time.now.to_i
33 # # Alternatively, if you know ahead of time all the fields you want to
34 # # set for an event, you can emit an event in one step:
36 # emitter.emit MyApp::Event2, :field1 => value1, :field2 => value2 # ...
39 # version of our library, currently 0.8.2
42 autoload :ClassMaker, "lwes/class_maker"
43 autoload :TypeDB, "lwes/type_db"
44 autoload :Struct, "lwes/struct"
45 autoload :Emitter, "lwes/emitter"
46 autoload :Event, "lwes/event"
47 autoload :Listener, "lwes/listener"