-
Notifications
You must be signed in to change notification settings - Fork 9
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
Platform Handle abstraction + connection negotiation code #45
Conversation
57f8c14
to
2fca4a2
Compare
58c0e45
to
1e0474a
Compare
expected_scheduled_after - Duration::from_millis(1) < scheduled_in | ||
&& scheduled_in < expected_scheduled_after | ||
); | ||
assert!(expected_scheduled_after - Duration::from_millis(5) < scheduled_in); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paullegranddc I had to up the Delta, as this test was failing intermitently for me on my laptop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Timing tests are flaky in essence if the clock is not an injected dependency sadly
0442b10
to
c074d87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, since there is use of the actual code, it's kind of hard to juge the API
81bd913
to
2be105b
Compare
ed10edb
to
8bbba91
Compare
expected_scheduled_after - Duration::from_millis(1) < scheduled_in | ||
&& scheduled_in < expected_scheduled_after | ||
); | ||
assert!(expected_scheduled_after - Duration::from_millis(5) < scheduled_in); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Timing tests are flaky in essence if the clock is not an injected dependency sadly
11f2a6c
to
942a0e8
Compare
Includes tools for safe handling of file descriptors, locks and forking a daemon subprocess / sidecar. With the recent stabilization of https://doc.rust-lang.org/std/os/unix/io/struct.OwnedFd.html I've removed some no longer necessary abstractions that basically reimplemented OwnedFd. I've used io-lifetimes crate to backport the implementation to older rust versions. The two biggest parts of this PR that lay groundwork for the IPC mechanism are: PlatformHandle<T> - which allows safe, ref-counted sharing of a FD both within the process and also facilitates transferring it between processes. it can be used across threads to send data through a shared socket without using locks avoiding mutexes is important as the process could be forked (e.g. in PHP) at anytime Liaison trait - which allows IPC to be set up between processes it implements mechanism to establish a shared named socket on the system only one process will take ownership of the listener type on the socket the rest will only connect to it when needed
942a0e8
to
7bc812a
Compare
First PR to merge in the IPC work
with basic framework for safe handling of file descriptors both within the process and across processes.
With the recent stabilization of https://doc.rust-lang.org/std/os/unix/io/struct.OwnedFd.html I've removed some no longer necessary abstractions that basically reimplemented OwnedFd. I've used
io-lifetimes
crate to backport the implementation to older rust versions.The two biggest parts of this PR that lay groundwork for the IPC mechanism are:
PlatformHandle<T>
- which allows safe, ref-counted sharing of a FD both within the process and also facilitates transferring it between processes.Liaison
trait - which allows IPC to be set up between processes