Today, I formalised what I think is a robust mechanism that uses structures developed over this time. The mechanism was seen through murky waters until I had finally developed the necessary data structures to carry it.
It is summed up by the diagram below.
The initiator, labelled as the upper rectangle and the respondent, labelled as the lower rectangle. The initiator can be any Agent Device. The respondent can be any Client Device (a Clique Space aware device that can participate in viscera, including Agent Devices and administrator clients).
Furthermore, the diagram shows how these Client Devices engage; how they establish their synapses; how they establish and communicate the Participants within each synapse.
The diagram can be further summed up by this slightly more formalised list, indicating which Participant is created at each stage of the process. The numbers coincide with each of the circled numbers in the diagram above.
- Initiator : Owner : Inbound : Create.
- Respondent : Owner : Outbound : Reconstituted from 1 as parameter.
- Respondent : Owner : Inbound : Create.
- Initiator : Owner : Outbound : Reconstituted from 3 as parameter.
- Initiator : Non-Owner : Outbound : Create.
- Respondent : Non-Owner : Inbound : Reconstituted from 5 as return.
- Respondent : Non-Owner : Outbound : Create.
- Initiator : Non-Owner : Inbound : Reconstituted from 7 as return.
The Inbound/Outbound distinction signifies the perspective each device has to the two channels. If, for example, a Client Device A is engaged with Client Device B, then the Inbound channel on A is the Outbound channel on device B. In this way, the synapse Cliques model directionality of both synapses between the two devices.
In all instances where the two engaging devices are both Agent Devices, Participants which are created by a device are possessed by the device. In instances where an Agent Device is engaging an administrator client (I'm thinking about calling this an administrator device), all Participants are possessed by the Agent Device.
So, the device initiating the engagement (possibly, but not exclusively through the engager server's "engage" method), firstly creates the Owner of its inbound channel. The process that completes an engagement as a respondent is then called by the initiating device on the responding device where the respondent first reconstitutes the owner of its outbound channel using the signal given to it by the initiator, and then creates the owner of its outbound channel. Next, the respondent asks the initiator to complete its engagement. The initiator first reconstitutes the owner of the outbound channel from the signal given to it by the respondent, and then creates the non-owner of the same channel. When the engager finishes, the respondent reconstitutes the non-owner of its inbound channel using the signal that is returned, and creates a non-owner for its outbound channel before the respondent process completes whereby control is returned back to the initiator. Finally, the initiator reconstitutes the inbound channel's non-owner using the signal that is returned.
Now, to implement...