]>
glassweightruler.freedombox.rocks Git - waydroid.git/blob - tools/helpers/ipc.py
1 # Copyright 2022 Alessandro Astone
2 # SPDX-License-Identifier: GPL-3.0-or-later
4 # Currently implemented as FIFO
10 return BASE_DIR
+ "waydroid-" + channel
12 def read_one(channel
):
13 with open_channel(channel
, "r", 1) as fifo
:
19 def create_channel(channel
):
20 pipe
= pipe_for(channel
)
21 if not os
.path
.exists(pipe
):
24 def open_channel(channel
, mode
, buffering
=0):
25 return open(pipe_for(channel
), mode
, buffering
)
27 def notify(channel
, msg
):
29 fd
= os
.open(pipe_for(channel
), os
.O_WRONLY | os
.O_NONBLOCK
)
30 with os
.fdopen(fd
, "w") as fifo
:
35 def notify_blocking(channel
, msg
):
36 with open_channel(channel
, "w", 1) as channel
: