Add a simple cross platfrom IPC lib in core:os #6775
A-Boring-Square
started this conversation in
Proposals
Replies: 1 comment
-
|
All of currently supported targets support UNIX Domain Sockets (Windows included). Mixing named pipes, xpc, and unix sockets into unified API is a terrible idea in practices, that's because each handles messages in different way. As an example, named pipes have built-in framing, while unix sockets don't, on top of that xpc expects dictionaries instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Odin currently does not provide a cross-platform local IPC abstraction in
core:os.Developers who need inter process communication must implement platform-specific solutions themselves, typically using Unix domain sockets on POSIX systems and Named Pipes on Windows. This results in duplicated effort across projects and encourages the creation of multiple third-party IPC libraries with differing APIs.
Proposed Solution
Provide a simple abstraction over OS specific IPC using the
io.Streaminterface and has support for:Implementation
This could be implemented via a struct like this
This would allow the IPC interface to use the standard
core:iointerface for IPC across different OSsWhy should this be in
core:os/ipcand notcore:net/ipcThe proposed API represents local operating system IPC facilities rather than network communication.
While the POSIX implementation may use Unix domain sockets internally, the abstraction is intended for communication between processes on the same machine. The Windows implementation would use Named Pipes, and other platforms may use different native IPC mechanisms.
Because the purpose of the API is to expose local IPC rather than networking,
core:os/ipcappears to be a more appropriate location thancore:net/ipc. The package would provide a common interface over operating-system IPC primitives while hiding platform-specific implementation details.Beta Was this translation helpful? Give feedback.
All reactions