Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: make doc match code as of 0.45.7

Table of Contents
maxLevel3

...

When the subscription ruleset is installed, a well known Rx channel is created. As a reminder, a channel contains three pieces of information: the long identifier (eci), a name, and a descriptive type. The well known channel name is wellKnown_Rx with Tx_Rx as its channel type. This channel is used to establish new subscriptions between picos, and is meant to be publicly shared with potential subscribers. In the future this channel will use policies This channel uses a policy to restrict events to only subscription requests, making your engine more secure.

...

  1. Pico A receives a wrangler:subscription event which includes a wellKnown_Tx attribute. wellKnown_Tx is Pico B's wellKnown_Rx .  Pico A then creates a channel for the subscription which is stored as Rx.
  2. Pico A sends pico B wrangler:pending_subscription with attribute status set to inboundsubscription_request_neededPico A sends all attributes it received with the following key attributes updated.
    1. Tx - Pico A Rx.
    2. Tx_verify_key - Pico A's Rx channel verifyKey.
    3. Tx_public_key - Pico A's Rx channel encryptionPublicKey.
    4. name - name used for channel.
    5. channel_type - string used for channel type
  3. Pico B creates a Rx channel for the subscription which is stored as Rx along with TxTx_verify_keyTx_public_key in inbound subscription entity variable.
    Pico A also raises an internal  wrangler:pendingnew_subscription_request event with status set to outbound, with the corresponding attributes above which is stored in outbound subscription entity variable
  4. After storing pending subscriptions, Pico B and Pico A raises corresponding wrangler:inbound_pending_subscription_added event and wrangler:outbound_pending_subscription_added event.
    The state of each Picos subscription is static at this point. Pico A has an outgoing pending subscription and Pico B has an incoming pending subscription.
  5. If Pico B wants to approve the subscription request, it raises the wrangler:pending_subscription_approval event with an attribute Rx containing the Rx channel identifier of the subscription to approve.  Upon successfully storing the subscription in established entity variable. Pico B: 
    1. sends the wrangler:outbound_pending_subscription_approved event with attribute status set to outbound to  event to Pico A on Pico B's subscriptions Tx. 
    2. raises an API internal event wrangler:subscription_added.
  6. Upon receiving the wrangler:pending_subscription_approved event, Pico A adds an Tx eci to the subscription and stores the subscription in established entity variable.  And raises the wrangler:subscription_added event.
  7. If Pico B wants to reject the subscription, it raises the wrangler:subscription_cancellation event (internally) with an attribute named Rx - which is the Rx of the subscription to reject. Pico B:
    1. sends the wrangler:established_removal event to Pico A on Picos B Tx eci, which then raises an internal API wrangler:subscription_removed event to itself.
    2. raises the wrangler:established_removal event, which then raises an internal API wrangler:subscription_removed event.

...

Event Domain

Event Type

Actions

Use

wranglersubscription

creates outbound pending subscription and sends pending_subscription event to external pico

Creates a new outbound pending subscription
wranglerpending_subscriptioncreates inbound pending subscriptionCreates a new inbound pending subscription
wranglerpending_subscription_approvalsends outbound_pending_subscription_approved event with inbound_eci and outbound status to external pico and raises inbound_pending_subscription_approved with inbound statusAprove inbound pending subscription
wrangler

subscription_cancellation |

inbound_rejection |

outbound_cancellation

sends subscription_removal event with eci and status and raise the same event to selfAlert external pico to remove subscriptions and alert self to remove subscription
wrangler

established_removal |

inbound_removal |

outbound_removal

deletes channel used for subscription and updates subscription ruleset persistanceInternally for removing channel used for subscription

...

NameValue
channel_namechannel name 
channel_typechannel type
Rx_ecipico A's new eci created for the subscription
Rx_rolepico A's role
status"outbound"
Tx_ecieci to other pico
Tx_host (only included if the
picos are hosted on different engines)
defined in wrangler:subscription
Tx_roledefined in wrangler:subscription

...

NameValue

attributes

attrs in wrangler:subscription
channel_namechannel name(e.g. "namespace:name")
channel_typedefined in wrangler:subscription
my_rolesubscriber_role in wrangler:subscription
namedefined in wrangler:subscription
name_spacedefined in wrangler:subscription
outbound_ecipico A's new eci created for the subscription
relationshipstring of the form my_role+"<->"+subscriber_rolestatus"inbound"
subscriber_host (only included if the
picos are hosted on different engines)
public DNS name of the engine hosting pico A
subscriber_rolemy_role in wrangler:subscription

...