This repository has been archived by the owner on Feb 4, 2018. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds BinderD, a background process running on the API server that makes it easy to create/manage long-running processes for log support, cluster monitoring, inactive app deletion, etc. All BinderD modules (
BinderDModule
base class) can receive messages over 0MQ using theBinderClient
class. ABinderClient
is passed a module name as a parameter, and exposes a simple interface on top of 0MQ'ssend
andrecv
messages.Currently, the only BinderD modules available are the
log_reader
and thelog_writer
modules.log_reader
responds to log queries (typeget
), and supports the optionalsince
parameter for fetching all logs matching a filter generatedsince
the specified timestamps.log_writer
takes messages (typelog
), each containing requiredtag
s andlevel
s, and:root
if the name's excluded) as the topic.Additionally, this PR includes a new WebSocket endpoint, which queries the
log_reader
module and subscribes to all messages from thelog_writer
's subscriber socket.All
print
statements in Binder have been replaced by the appropriatelog_*
messages inlog.py
, which send messages to thelog_writer
module.