ApiManager

ancient-cursor. ApiManager

Manager of many api for sync data with cursors.

Constructor

new ApiManager(adapterFindApi, adapterSend)

Source:
Parameters:
Name Type Description
adapterFindApi ApiManager~adapterFindApi
adapterSend ApiManager~adapterSend

Methods

channelDisconnected(channelId)

Call channelDisconnected method apply cursorDestroyed for each cursor used in current channelId.

Source:
Parameters:
Name Type Description
channelId UniqueId

cursorDestroyed(channelId, cursorId)

Call cursorDestroyed method into api serving for current cursor sync.

Source:
Parameters:
Name Type Description
channelId UniqueId
cursorId UniqueId

findApi(apiQuery) → {Promise}

Find api object.

Source:
Parameters:
Name Type Description
apiQuery Query
Returns:
Type:
Promise
  • ApiObject

receiveQuery(channelId, apiQuery, query, cursorId) → {Promise}

Receive some query from some channelId, with possible need to sync result with some cursorId on channel cursors namespace.

Source:
Parameters:
Name Type Description
channelId UniqueId
apiQuery Query
query Query
cursorId UniqueId
Returns:
Type:
Promise
  • ApiObject

Type Definitions

adapterFindApi(apiQuery) → {Promise}

Must be sended into ApiManager into constructor. Used for found api instance by apiQuery, from custom application storage logic.

Source:
Parameters:
Name Type Description
apiQuery Query
Returns:
Type:
Promise
  • ApiObject

adapterSend(channelId, bundles)

Must be sended into ApiManager into constructor. Used for send bundles from api to cursor into current and channelId within custom application logic.

Source:
Parameters:
Name Type Description
channelId UniqueId
bundles Array.<Bundle>

sendBundles(channelId, bundles)

Source:
Parameters:
Name Type Description
channelId UniqueId
bundles Array.<Bundle>