0.0.7 • Published 10 years ago

amqp-vent v0.0.7

Weekly downloads
21
License
-
Repository
github
Last release
10 years ago

amqp-vent

PubSub event bus over amqp

Installation

npm install amqp-vent

Example Subscribe

{Vent} = require("amqp-vent")
vent = Vent("amqp://guest:guest@localhost:5672/bus")
vent.subscribe(
    topic: "*.happening"
    channel: "random"
    group: "server"
, (msg) ->
    console.log("I hear some stuff was happening", {msg})
)
vent.subscribe(
    topic: "#"
    channel: "random"
    group: "server"
, (msg) ->
    console.log("me too", {msg})
)

Example Publish

{Vent} = require("amqp-vent")
vent = Vent("amqp://guest:guest@localhost:5672/bus")
vent.publish(
    topic: "stuff.happening"
    channel: "random"
    message:
        hey: "whats up!!"
)

colon separated option

you can also specify the publish/subscribe option with a colon separated string, for convenience in the format "channel:topic:group"

vent.publish("random:stuff.happening", {message: hey: "whats up!!"})
vent.subscribe("random:#:server", event_handler)
0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago