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

Refactor OS-dependant FIFOs to abstract away OS differences. #15

Open
rodrigogiraoserrao opened this issue Nov 23, 2021 · 0 comments
Open
Labels
enhancement For non-critical additional improvements.

Comments

@rodrigogiraoserrao
Copy link
Contributor

In IPC.py, we define a couple of classes to represent FIFOs.
In particular, we implement a FIFO for Unix systems and another one for Windows systems.
Then, the file ends with a global if statement that defines FIFO to be the appropriate class for the given operating system.
This is a bit flaky.

Instead, we could look at how pathlib (from the standard library) implements Path, which dynamically figures out the OS it's in.
(Plot twist: this is done through the dunder method __new__.)

In doing this, we should figure out what exactly is the protocol that we need from the FIFOs, so that we can implement that protocol for the two types of systems.
When this is done properly, there will be no need to keep differentiating from the two types of FIFOs in the remainder of the code.

@rodrigogiraoserrao rodrigogiraoserrao added the enhancement For non-critical additional improvements. label Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For non-critical additional improvements.
Projects
None yet
Development

No branches or pull requests

1 participant