Class: RemoteMessaging

DefaultDB.RemoteMessaging()

Remote messaging is an interface based on the relay clients of the module message-relay-services. For this stack (default storage stack for Copious Transitions) the client intiates all activiy.

Most requests for information will be keyed by the _id field, which is supposed to store a wide area identifier of the object.

When the field parameter is used, the client, that this class represents, expects that the _x_key_field will be useful to the data service (e.g a DB).

Given that this client wrapper may interact with a relay services managing paths, the request are sent on a path. The path may be configured. The constructor will use default_m_path in some cases, but it is not specified, 'persistence' will be the path used by default.

Constructor

new RemoteMessaging()

Source:

Methods

(async) publish(topic, obj) → {object}

Provide an interface to publication that a subclass might use in certain situations. Also, some users of the class instances may request publication of new data.

Parameters:
Name Type Description
topic string
obj object
Source:
Returns:
  • the server response to the subscription request
Type
object

(async) remote_fetch_message(wa_id, field) → {object|boolean}

remote_fetch_message --- this is a request -- meta search request... calls get on path

Parameters:
Name Type Description
wa_id string

The wide area id of the object

field string

the field that is to be used as the key for identifying the object _id is the default.

Source:
Returns:
  • returns the recovered object or false
Type
object | boolean

remote_store_dereference(wa_id)

Let remote systems know that this objet is not going to be stored locally.

If the architecture is set up to keep objects for a number of users, the object might not be removed from existence by other process, but those processes might keep track of how many copies are in existence.

Parameters:
Name Type Description
wa_id string

the wide area identity

Source:

remote_store_message(obj, user_op)

Parameters:
Name Type Description
obj object
  • the data object that will be stored remotely.
user_op string
  • this is used if the message is going to an endpoint providing operations.
Source: