Skip to content

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

@rodrigogiraoserrao

Description

@rodrigogiraoserrao

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFor non-critical additional improvements.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions