Signals are small messages, with a payload of up to 64 bytes. Like messages, signals are replicated to all global data centers but its pricing is far lower, making signals ideal for high-volume streams of data.
Maximum size of signal payload
By default, signals are limited to a message payload size of
64 bytes. This limit applies only to the payload, and not to the URI or headers. If you require a larger payload size, please contact support.
Don't JSON serialize
You shouldn't JSON serialize when sending signals/messages via PubNub. The serialization is done for you automatically. If you are sending JSON, just pass the full object as the message payload. PubNub takes care of everything for you.
The data about an individual signal is stored as a slice in a normalized pool of Signals. The following example shows the shape of a list of Signals in the store:
The PubNub Redux framework provides reducers your app can implement that respond to various actions that update the store. To track the state of a set of objects in the store, combine the reducers you want into the rootReducer for your app.
createSignalReducer instantiates a reducer in the store that responds to actions dispatched to update the state of signals in the store.
The PubNub Redux framework includes listeners that monitor PubNub events from the server and dispatch corresponding actions. All listeners are automatically invoked if your app registers the combined PubNub listener. You can register only specific listeners, or implement your own combine listeners function.
createSignalListener registers a listener in the store that monitors when signals are received from the server, and dispatches corresponding actions to update the store.
A sample implementation of a signal listener:
The PubNub Redux framework provides commands that your app can dispatch to the store to be managed by the Thunk middleware. Commands interact with the PubNub API and dispatch basic actions which are then processed by reducers to update the state in the store.
Send a signal packaged in a request object.
sendSignal( request, [meta] );
|Yes||Message content request parameter object.|
|Optional||Standard meta options object.|
|Yes||n/a||The message may be any valid JSON type, including objects, arrays, strings, and numbers.|
|Yes||n/a||The channel name to publish messages to.|
sendSignal Sample Usage