Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework threading client #153

Closed
danielballan opened this issue Feb 10, 2018 · 1 comment
Closed

Rework threading client #153

danielballan opened this issue Feb 10, 2018 · 1 comment

Comments

@danielballan
Copy link
Collaborator

danielballan commented Feb 10, 2018

Notes to self. Implementation in progress.

  1. The user asks for one or more PVs, providing name and priority.
  2. The Context:
    • Have I already got a PV instance for this? If so, return that. If not, allocate a cid and instantiate a corresponding PV object.
    • For all the new PV objects just created above, send [(name, cid), (name2, cid2)] to the Broadcaster to search.
    • Cache the cid -> PV mapping and return a list of PV objects, some or all of which may not be connected yet.
  3. The Broadcaster:
    • Do I have an unexpired search result for this? If so, send (address, (cid1, cid2, ...)) to the Context. If not, send a SearchRequest using the cid provided by the Context.
    • In the recv loop, send (address, (cid1, cid2, ...)) to the Context as updates come in. (I think that all Contexts are current notified, which is a problem because they have different cids.... this could be solved using a queue per context, as we do in ChannelData.)
  4. The Context:
    • Receives (address, (cid1, cid2, ...)) from the Broadcaster in its channel creation queue.
    • Looks up the cid in its cache to find the PV, which knows the priority. Checks: do I have a VirtualCircuitManager for this (address, prority) yet? If not, create a socket and a VirtualCircuitManager.
    • Creates a caproto.ClientChanel. (There is not need for a special Channel class.)
    • Tacks a reference to this caproto.ClientChannel and to the VirtualCircuitManager onto the PV.
    • Sends creation messages via VirualCircuitManager.send.
  5. The VirtualCircuitManager:
    • Receives channel creation confirmation.
    • Looks up cid on the VirtualCircuitManager. Tells the PV it is connected via updating a connected attribute and possibly setting an Event, to make it possible to wait on PV connection.
@danielballan danielballan added this to the 0.1.0 milestone Mar 16, 2018
@danielballan
Copy link
Collaborator Author

Closed by #161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

1 participant