-
-
Notifications
You must be signed in to change notification settings - Fork 723
Use socket for IPC #2539
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
Merged
Merged
Use socket for IPC #2539
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #2539 +/- ##
==========================================
+ Coverage 10.83% 11.43% +0.59%
==========================================
Files 149 153 +4
Lines 10779 11127 +348
==========================================
+ Hits 1168 1272 +104
- Misses 9611 9855 +244
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
5 tasks
051bec6 to
092641b
Compare
4 tasks
Unfortunately, we can only show the warning in the polybar log and not give the user any feedback because the pipe is one-way
Should be independent from eventloop logic
14 tasks
This only happens for commands and empty actions. Non-empty actions are not immediately executed, but deferred until the next loop iteration.
The socket file is not deleted after socket.close() is called, only after libuv executes the close callback. So we can't just call rmdir because it will probably always fail.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
Using a single fifo to accept IPC messages does not work. It fails when multiple people want to send concurrently or when messages arrive close to eachother.
That's why polybar should use a socket for IPC.
In addition
/run/user/UID/is a safer place to put the socket.This deprecates using the fifo.
TODOs:
polybar-msguse the socketpolybar-msg actionmore user-friendly by letting it accept 2 or 3 arguments. (2 for module name + action and 3 when it includes data).polybarandpolybar-msgshould print a warning when it is used.polybar-msgshould convert each such call to an action messages (that way we can completely remove hooks from the socket message format).Related Issues & Documents
Fixes #2532
Closes #2465
Fixes #2504
Documentation (check all applicable)
This PR also moves the IPC documentation to the repo. The wiki sidebar and all other links to the IPC page should be updated to point to RTD (on stable). In addition, the IPC wiki page should have at least a banner at the top, linking to RTD and maybe the rest of the page should be removed as well.
This also adds a small manpage for
polybar-msg