A Functional Reactive Game Engine
Reventex is published on NPM with full typing support. To install use
npm install reventex
This will allow you to import Reventex entirely using:
The Bus is a one-to-many communication and implements a publish/subscribe event distribution model. A publisher sends a event on a channel. Any active subscriber listening on that channel receives the event. Subscribers can register interest in wildcard channels.
Subscribers express interest in one or more channels, and only receive events that are of interest, without knowledge of what publishers there are.
Events sent by other clients to these channels will be pushed by Bus to all the subscribed clients.
A client subscribed to one or more channels should not issue commands, although it can subscribe and unsubscribe to and from other channels. The replies to subscription and unsubscription operations are sent in the form of events, so that the client can just read a coherent stream of events where the first element indicates the type of event. The commands that are allowed in the context of a subscribed client are:
publish(event: Event): Void
subscribe(channel: String): Void
unsubscribe(channel: String): Void
match(pattern: Pattern, generator: Generator): Void
delay(ms: Int): Void
call(callback: Function, ...args): Void
Channel Naming Conventions
Channel names, including reply channel names, are case-sensitive and must be non-empty alphanumeric strings with no embedded whitespace, and optionally token-delimited using the dot character (
FOO.BAR.BAZ are all valid channel names
foo. .bar and
foo..bar are not valid channel names
Reventex supports the use of wildcards in channel subscriptions.
- The asterisk character (
*) matches any token at any level of the channel.
- The greater than symbol (
>), also known as the full wildcard, matches one or more tokens at the tail of a channel, and must be the last token. The wildcarded channel
foo.bar.baz.1, but not
- Wildcards must be separate tokens (
foo.>are syntactically valid;
foo>are not) For example, the wildcard subscriptions
foo.bar.quux, but only the latter matches
foo.bar.baz. With the full wildcard, it is also possible to express interest in every channel that may exist in Reventex.
Please use Github Issues to report bugs or request features.
Please follow these steps to report a bug
Search for related issues - search the existing issues so that you don't create duplicates
Create a testcase - Please create the smallest isolated testcase that you can that reproduces your bug
Share as much information as possible - everything little helps, OS, node/browser version, all that stuff.
If you are contributing a bug-fix or a very minor addition, feel free to do a pull request on the master branch.
If it is something else create a new (or existing) feature branch (eg:
feature/my-feature) and issue a pull request on that.
If unsure, create an issue to discuss.
- Twitter: https://twitter.com/reventexjs
Reventex is released under the MIT License.