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

Review: Add Communicator #11

Closed
wants to merge 2 commits into from
Closed

Review: Add Communicator #11

wants to merge 2 commits into from

Conversation

BenediktBurger
Copy link
Member

The Communicator is a simple utility to send messages via LECO and read the answer.

It does not run in another thread and does not interpret messages (not even ping requests), unless the read method is called.

The use case is for simple scripts, where you want to send a message and read the answer without the hassle to set up other threads etc.

In order to work, the ask method has to do some checks:

  • If the Coordinator tells, that the Communicator is not signed in, it signs in and sends the message a second time
  • All ping requests (from the Coordinator) since the last communication are dropped, as they are meaningless, since a new message has been sent.

For easier usage, the Communicator is a context manager (at enter it signs in, at exit it signs out).

@github-actions
Copy link

PyLECO Coverage

Coverage Report
FileStmtsMissCoverMissing
pyleco
   test.py612558%36, 39, 42, 63, 66–67, 70, 73, 76, 96, 100–101, 106–110, 113, 116, 119, 122–124, 127–128
pyleco/core
   internal_protocols.py12192%70
pyleco/utils
   communicator.py1423372%79–>81, 90–96, 101–>exit, 103, 109–110, 118, 128–131, 153, 175–177, 187–194, 203–209, 227, 240, 243, 247
TOTAL3535982% 

Coverage Summary

Tests Skipped Failures Errors Time
98 0 💤 0 ❌ 0 🔥 0.704s ⏱️

@BenediktBurger
Copy link
Member Author

As a review is not happening in foreseeable future, I make this PRs a draft.

Whenever someone has time to review, I'll push the most recent version.

@BenediktBurger BenediktBurger marked this pull request as draft October 27, 2023 09:46
Copy link

github-actions bot commented Jan 3, 2024

PyLECO Coverage

Coverage Report
FileStmtsMissCoverMissing
pyleco
   test.py1145349%39, 42, 64, 67, 70–71, 74, 80, 99, 103–108, 111–119, 134–138, 143, 156–160, 163, 166, 169, 172–174, 177, 180–181, 218–220, 223–226, 230–233
pyleco/core
   internal_protocols.py281147%87–90, 102–106, 110–114
pyleco/utils
   communicator.py1482580%94, 111–112, 119–>121, 130–133, 155–>157, 187–189, 201–202, 206, 217–223, 229–231, 243, 256, 259, 263
TOTAL4358977% 

Coverage Summary

Tests Skipped Failures Errors Time
106 0 💤 0 ❌ 0 🔥 0.630s ⏱️

@BenediktBurger BenediktBurger changed the base branch from main to reviewed January 29, 2024 14:00
@BenediktBurger BenediktBurger changed the title Add Communicator Review: Add Communicator Apr 10, 2024
@BenediktBurger
Copy link
Member Author

As it is unknown, when this will be reviewed: Closed.

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.

1 participant