feat(subscriptions): add and remove subscribers

This commit adds two new commands to add and remove subscribers to
WindowManagerEvent and SocketMessage notifications after they have been
handled by komorebi.

Interprocess communication is achieved using Named Pipes; the
subscribing process must first create the Named Pipe, and then run the
'add-subscriber' command, specifying the pipe name as the argument
(without the pipe filesystem path prepended).

Whenever a pipe is closing or has been closed, komorebi will flag this
as a stale subscription and remove it automatically.

resolve #54
This commit is contained in:
LGUG2Z
2021-10-25 09:31:56 -07:00
parent f17bfe267e
commit 6ae59671a2
12 changed files with 146 additions and 8 deletions

12
Cargo.lock generated
View File

@@ -525,6 +525,7 @@ dependencies = [
"hotwatch",
"komorebi-core",
"lazy_static",
"miow 0.3.7",
"nanoid",
"parking_lot",
"paste",
@@ -662,7 +663,7 @@ dependencies = [
"kernel32-sys",
"libc",
"log",
"miow",
"miow 0.2.2",
"net2",
"slab",
"winapi 0.2.8",
@@ -692,6 +693,15 @@ dependencies = [
"ws2_32-sys",
]
[[package]]
name = "miow"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "nanoid"
version = "0.4.0"