0.2.10 • Published 9 years ago

syncsocket-client v0.2.10

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

SyncSocket-client

Synchronized messaging application framework client

Build Status codecov npm npm PRs Welcome

API Docs

Channel

Channel constructor

Parameters

  • connection
  • spec Object Connection options
    • spec.channelId string The channel identifier
    • spec.isPublisher Boolean Flag whether or not user can publish to this channel

subscribe

Subscribes for messages on given topic. Subscribing to topic # will make you subscribe to any message in the channel.

Parameters

  • topic string
  • prepareCallback function (Any): Any The callback called during prepare transition
  • fireCallback function (Any): Any The callback called during the 'fire' event

publish

Publishes a user message to the channel

Parameters

Channel#transition

Channel switched state

Properties

  • from string State transition was from
  • to string State transitioned to

Channel#error

Error in channel

Channel#syncSuccessful

Synchronization with timeserver succeeded

Properties

  • error number Reading's max variation from truth (ms)
  • adjust number Difference between local and remote clocks (ms)

Channel#syncFailed

Synchronization with timeserver failed

Properties

  • error number Reading's max variation from truth (ms)
  • adjust number Difference between local and remote clocks (ms)

Connection

Creates new Connection object

Parameters

close

Disconnects from the server

joinChannel

Attempt joining a channel with id channelId.

Parameters

  • channelId
  • canPublish

Returns Promise Fulfilled promise returns the Channel object, rejected — error message.

Connection#connected

Client successfully connected to server

Connection#error

Connection error

Connection#disconnected

Client disconnected from server

Connection#connection-error

Error while connecting to server

connect

Attempts connection to a SyncSocket server.

Parameters

Returns Connection Connection object.

connect

Attempts connection to a SyncSocket server.

Parameters

Returns Connection Connection object.

Connection

Creates new Connection object

Parameters

close

Disconnects from the server

joinChannel

Attempt joining a channel with id channelId.

Parameters

  • channelId
  • canPublish

Returns Promise Fulfilled promise returns the Channel object, rejected — error message.

Channel

Channel constructor

Parameters

  • connection
  • spec Object Connection options
    • spec.channelId string The channel identifier
    • spec.isPublisher Boolean Flag whether or not user can publish to this channel

subscribe

Subscribes for messages on given topic. Subscribing to topic # will make you subscribe to any message in the channel.

Parameters

  • topic string
  • prepareCallback function (Any): Any -- The callback called during prepare transition
  • fireCallback function (Any): Any -- The callback called during the 'fire' event

publish

Publishes a user message to the channel

Parameters

0.2.10

9 years ago

0.2.9

9 years ago

0.2.8

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago