WIP on 297 unsolicited messages, from initial connection and on device events by auphofBSF · Pull Request #298 · ISISComputingGroup/lewis · GitHub
Skip to content

WIP on 297 unsolicited messages, from initial connection and on device events - #298

Open
auphofBSF wants to merge 4 commits into
ISISComputingGroup:mainfrom
auphofBSF:wip_297_unsolicited_messages
Open

auphofBSF wants to merge 4 commits into
ISISComputingGroup:mainfrom
auphofBSF:wip_297_unsolicited_messages

Conversation

@auphofBSF

Copy link
Copy Markdown

This PR attempts to solve #297 , it provides mechanisms to

  1. provide an initial message on a TCP client connecting to a StreamInterface - thank you @DominicOram
  2. provides a mechanism for a device to generate a message to TCP clients such as from an event and it is sent to all StreamHandlers with connected clients. This could be from regular periodic events or any other non regular computed events

In addition an example is provided in lewis.examples accessible as lewis -k lewis.examples simple_eventing_state_device

Subject to initial review, docs and possibly some tests need to be generated

DominicOram and others added 4 commits June 16, 2021 10:04
A CRUDE but working first attempt
(But throws Errors and Eventually Disconnects)
to all stream handlers

check method names
check attachement of adapters to devices in simulation
@DominicOram

Copy link
Copy Markdown
Contributor

Comment thread lewis/adapters/stream.py

def process(self, msec):
for handler in self._accepted_connections:
if self._device_event_message:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I am missing something but where does self._device_event_message get set?

@mattclarke

Copy link
Copy Markdown
Contributor

I think this looks promising, obviously as a WIP there are a few rough edges.

I am wondering about whether we need an new abstraction for this type of thing, but I would need to remind myself of how lewis works ;)
What I am wondering is if the device should just keep track of whether it has messages to send and something else grabs them and sends them to the adapters rather than giving the device direct access to the adapters.

We'll see what @DominicOram thinks when he gets back, but I think this implementation would be okay.

@DominicOram

Copy link
Copy Markdown
Contributor

Sorry, I haven't forgotten about this, it's just low priority for me right now. Are you wanting it to be merged soon @auphofBSF?

@auphofBSF

Copy link
Copy Markdown
Author

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants