Skip to content

Commit

Permalink
readme update + version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
kalmyk committed Mar 14, 2020
1 parent c3c8998 commit 2eb42d0
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 26 deletions.
52 changes: 36 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,22 @@ includes frontend part on React JS and backend server on Fox-WAMP.

https://github.com/kalmyk/reflux-chat

## Map-Reduce
Map-Reduce processing in terms of message queue is tranforming of the input stream
to be passed to the corresponding event topic and reduced there.
As Map function is possible to use any regular function registration.
Reduce is the function that gather events published to topic to the ratained dataset.
## Retained Storage
There is a storage to keep last content of published message.
The values from the storage could be retrived as immediate initial messages for the subscription if `retained` flag is pecified.

```javascript
register('reduce.the.key.#', (args, kwargs, options) => {
return options.retained + kwargs.value
register('key.value.#', (args, kwargs, options) => {
console.log('event-handler', args, kwargs)
},
{reducer: true})
{ retained: true }
)
```

## Retained Storage
There is storage to keep last published message. The server maintains persistence of keys. The values are provided as immediate first message for the subscription if `retained` flag is pecified.
and corresponding client code that consumes such retained events could be as following

```javascript
session.publish('the.key', [ 'args' ], { kwArgs: true }, {
session.publish('key.value.1', [ 'args' ], { kwArgs: true }, {
retain: true,
when: { status: 'started' },
watch: false
Expand All @@ -97,14 +95,36 @@ session.publish('the.key', [ 'args' ], { kwArgs: true }, {
```

### Publish Options Description
* retain: boolean, keep in Key Value storage. Default value is false that means message does not retain.
* retain: boolean, keep in Key Value storage. Default value is false that means message does
not retain.
* when: struct, publish only if the key meets requirements. null means that key should not be exists.
* watch: boolean, applicable if `when` option defined. Provide ability to wait for the necesssary condition and then do action immediately. If several clients waits for same value the only one achieves acknowledge of message.
* will: value that will be assigned at the session disconnect. If the value is changed by another
process the will value is cleaned.
* watch: boolean, applicable if `when` option defined. Provide ability to wait for the necesssary
condition and then do action immediately. If several clients waits for same value the only one achieves acknowledge of message.
* will: value that will be assigned at the session disconnect. If the value is changed by any
process the `will` value is cleaned.

### Synchronization Service
The options above provide ability to use the server as Synchronization Service. The `watch` option
is designed to delay acknowledge response of publish due to necessary conditions achieved that
is described in `when` option. See the demo in `democli\resource-lock.js`

## Map-Reduce, coming soon
Map-Reduce processing in terms of message queue is tranforming of the input stream
to be passed to the corresponding event topic and reduced there.
As Map function is possible to use any regular function registration.
Reduce is the function that gather events published to topic to the ratained dataset.

```javascript
register('reduce.the.key.#', (args, kwargs, options) => {
return options.retained + kwargs.value
},
{ reducer: true }
)
```

### Subscribe Options
* retained: boolean, corresponding values from key value storage will be returned as immidiate events.
* reducer:

### Aggregate Engine for the data streams

Expand Down Expand Up @@ -157,7 +177,7 @@ process the will value is cleaned.
"total": { "type": "string" }
},
"primary_key": [ "customer" ],
"sum": [ "amount" ]
"sum": [ "total" ]
}
```

Expand Down
13 changes: 6 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fox-wamp",
"version": "0.7.4",
"version": "0.7.5",
"description": "Web Application Message Router/Server WAMP/MQTT",
"author": {
"name": "Anatoly Tsapkov",
Expand All @@ -24,9 +24,9 @@
"dependencies": {
"commander": "^2.20.3",
"jsonschema": "^1.2.5",
"mqtt-packet": "^6.3.0",
"node-statsd": "*",
"mqtt-packet": "^6.3.2",
"msgpack-lite": "*",
"node-statsd": "*",
"qlobber": "^3.1.0",
"ws": "^6.2.1"
},
Expand Down

0 comments on commit 2eb42d0

Please sign in to comment.