Note |
---|
"io.picolabs.collection" must be installed on your pico for these to work |
Functions
membersReturns all of the established subscriptions that belong to the collection ReturnsAn array of subscription maps ParametersNone Returns An array of established subscriptions. Code Block |
---|
language | js |
---|
theme | Confluence |
---|
title | Example |
---|
| 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_memberswrangler:send_event_to_collection_membersThis 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. AttributesAttribute | Datatype | Description |
---|
domain | String | The domain of the event you want to send | type | String | The type of the event you want to send | attrs | Map | The attrs of the event you want to send |
Directives ReturnedWill return empty directives.
new_role_namescollection:new_role_namesCan 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. AttributesAttribute | Datatype | Description |
---|
Rx_role | String | The new role for the collection pico to take in the collection subscriptions. | Tx_role | String | The new role for the member picos to take in the collection subscriptions. |
Directives ReturnedWill return empty directives.
|