Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content fixed

...

Excerpt


Note

"io.picolabs.collection" must be installed on your pico for these to work

Functions


members

Returns all of the established subscriptions that belong to the collection

Returns

An array of subscription maps

Parameters

None

Returns 

An array of established subscriptions.

Code Block
languagejs
themeConfluence
titleExample
membersArray = collection:members()
[
  {
    "Rx_role": "collection",
    "Tx_role": "member",
    "Tx_host": "http://10.37.94.198:8080",
    "Id": "cjyf4v8hd00vuokbz0oz2eb1z",
    "Tx": "YVreELgbGjjFhQYqgGcRKm",
    "Rx": "VQDgK9YF1FPvj7fkwgt94H",
    "Tx_verify_key": "JAhWwk19WqBysronQPD6zbbncLDo7UHT22oaKcZ2dheB",
    "Tx_public_key": "5iArABfAiG8u4SNBhaCzcwtXpauLULfhMkJfHWTkMhe2"
  },
  {
    "Rx_role": "collection",
    "Tx_role": "member",
    "Tx_host": "http://10.5.164.58:8080",
    "Id": "cjygcdpqs0010q3bz05gc68gb",
    "Tx": "RrS9tyHwt8mBuTe7e33BMY",
    "Rx": "CuGaocn4tR2Q32tgBvmBjt",
    "Tx_verify_key": "EYdZVZhZ5cWwWtwCLuUpAnYXjXgFjRDphg1fCxNJVvBc",
    "Tx_public_key": "74Hmo86S5ifVtSyJaCr4wBy6j4sFeJiHSFLaGSUEV5WF"
  }
]
*/

Received Events


send_event_to_collection_members

wrangler:send_event_to_collection_members

This pico event relies on the internal Rx_role of the collection to send an event to all the members in the collection across the subscription from the collection pico to the members.

Attributes

AttributeDatatypeDescription
domainStringThe domain of the event you want to send

type

StringThe type of the event you want to send
attrsMapThe attrs of the event you want to send

Directives Returned

Will return empty directives. 


new_role_names

collection:new_role_names

Can be used to create a different Rx_role - Tx_role pairing for the collection. By default the collection pico's Rx_role is "collection" and member picos have "member" roles. It will only be successful if the collection has no members.

Attributes

AttributeDatatypeDescription
Rx_roleStringThe new role for the collection pico to take in the collection subscriptions.
Tx_roleStringThe new role for the member picos to take in the collection subscriptions.

Directives Returned

Will return empty directives. 


...