wisper
regex pub/sub
WARNING: This project is in alpha. To be clear, that means I haven't asked anyone else to use it yet - the only testing it has is internal.
ANOTHER WARNING: It should be clear from the version, but this project is not stable. At the moment, I make no guarantees about API or features. I know what I intend, but a lot can happen in early development.
Use
Here is a series of functions showing use, distilled from the tests. The tests (in the spec
directory) showcase more advanced use.
var wisper = ;var hub = wisper;var client = wisper;var pattern = '^p.*$'; { // set up hub hub;} { // connect client to hub client;} { // subscribe client to p.* client;} { var messageToPublish = "is anyone out there?"; var channelToPublishOn = "public"; client; client;} { client;} { hub; hub;} { var messageToPublish = "is anyone out there?"; var channelToPublishOn = "public"; // expect client not to get message on channel and match client; // expect the following to throw an exception for publishing on a closed client // the client will have become closed when the hub was closed. client1;}
API
For now, see the source for the API. It's pretty well documented there.