Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,18 @@ port is quite simple:
it takes an optional hash with arguments:

Librevox.start SomeListener, :host => "1.2.3.4", :port => "8087", :auth => "pwd"

filters can be applied to a listerner with the filters argument

Librevox.start SomeListener, :filters => ["Event-Name CHANNEL_EXECUTE", "Event-NAME HEARTBEAT"]

Multiple listeners can be started at once by passing a block to `Librevox.start`:

Librevox.start do
run SomeListener
run OtherListener, :port => "8080"
end


## Closing connection

Expand Down
2 changes: 0 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

- check command/application input and raise ArgumentError, possibly.

- filter events

- move test suite from bacon -> test/unit.

- test how this works in async mode - I imagine that it might mess with
Expand Down
4 changes: 3 additions & 1 deletion lib/librevox/listener/inbound.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def initialize args={}

@auth = args[:auth] || "ClueCon"
@host, @port = args.values_at(:host, :port)

@filters = args[:filters] || []

EventMachine.add_shutdown_hook {@shutdown = true}
end

Expand All @@ -17,6 +18,7 @@ def connection_completed
super
send_data "auth #{@auth}\n\n"
send_data "event plain ALL\n\n"
@filters.each { |f| send_data "filter #{f}\n\n" }
end

def unbind
Expand Down