Skip to content

Add pubsub implementation#6

Merged
smoynes merged 3 commits intomasterfrom
event-queue
Aug 10, 2013
Merged

Add pubsub implementation#6
smoynes merged 3 commits intomasterfrom
event-queue

Conversation

@agentultra
Copy link
Copy Markdown
Owner

I created a naive and ludicrously simple pub-sub system. It's so simple I fear I must be doing something wrong. But it works quite well so...

Added a publish-subscribe module to allow functions in different parts
of the application to communicate in a "loosely-coupled," manner.  The
impetus was to allow the reaper co-routine to take events out of the
index, change their state to "expired", and send them back through the
streams.

This patch updates the datagram handler function to use the pubsub
pattern to send recieved events into the stream-processing functions
instead of processing them itself.

The reaper process then just has to publish events to the same
listener topic.
We should ensure that when subscribe is called that the listener will
be added to the topic before any further events are published to that topic.
@smoynes
Copy link
Copy Markdown
Collaborator

smoynes commented Jun 28, 2013

Well, it is missing tests.

But aside from that, it looks simple, but does the job.

smoynes added a commit that referenced this pull request Aug 10, 2013
@smoynes smoynes merged commit 33de66f into master Aug 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants