1.7.1 • Published 9 years ago
sg-socket-constants

Constants variables for socket
Installation
$ npm install sg-socket-constants --save
Usage
'use strict'
const {
LockingEvents
} = require('sg-socket-constants')
const sgSocketClient = require('sg-socket-client')
let socket = sgSocketClient('http://localhost:8004')
socket.emit(LockingEvents.LOCK, {
name: 'resource01',
by: 'me'
})
Values
AcknowledgeStatus
| Key | Value |
|---|
| OK | sg:acknowledge:ok |
| NG | sg:acknowledge:ng |
AuthEvents
| Key | Value |
|---|
| AUTHENTICATION | authentication |
| AUTHENTICATED | authenticated |
| UNAUTHORIZED | unauthorized |
GreetingEvents
| Key | Value |
|---|
| HI | sg:greet:hi |
| BYE | sg:greet:bye |
LockingEvents
| Key | Value |
|---|
| ALLOC | sg:lock:alloc |
| RELEASE | sg:lock:release |
| LOCK | sg:lock:lock |
| UNLOCK | sg:lock:unlock |
ObservingEvents
| Key | Value |
|---|
| START | sg:remote:start |
| STOP | sg:remote:stop |
| CHANGE | sg:remote:change |
PubsubEvents
| Key | Value |
|---|
| RAISE | sg:pubsub:raise |
| SHUT | sg:pubsub:shut |
| PUBLISH | sg:pubsub:publish |
| COUNT | sg:pubsub:count |
| SUBSCRIBE | sg:pubsub:subscribe |
| UNSUBSCRIBE | sg:pubsub:unsubscribe |
| RECEIVE | sg:pubsub:receive |
RemoteEvents
| Key | Value |
|---|
| SPEC | sg:remote:spec |
| DESPEC | sg:remote:despec |
| PURGE | sg:remote:purge |
| JOIN | sg:remote:join |
| LEAVE | sg:remote:leave |
| PERFORM | sg:remote:perform |
| RESULT | sg:remote:result |
| PIPE | sg:remote:pipe |
| ERROR | sg:remote:error |
| NOTICE | sg:remote:notice |
ReservedEvents
| Key | Value |
|---|
| CONNECTION | connection |
| CONNECT | connect |
| RECONNECT | reconnect |
| CONNECT_ERROR | connect_error |
| CONNECT_TIMEOUT | connect_timeout |
| DISCONNECT | disconnect |
| ERROR | error |
License
This software is released under the Apache-2.0 License.
Links