Skip to content

Commit a18356b

Browse files
committed
readme
1 parent c383800 commit a18356b

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,42 @@
11
# process-queue :train:
22

3+
process-queue is a tool for queuing sequential program executions using
4+
different sets of arguments.
5+
6+
## Examples
7+
8+
process-queue server can be started with the `server` sub-command. In this
9+
example, we start a pqueue server that will execute `echo` with two arguments,
10+
"Hello" and one supplied by the sender.
11+
12+
pqueue server echo Hello {}
13+
14+
Once the server is listening we can start sending in jobs by running:
15+
16+
pqueue send world
17+
18+
We can see the string "Hello world" got printed in the terminal running the
19+
server. The server will keep listening for new jobs, if we now execute:
20+
21+
pqueue send "John Doe"
22+
23+
We will see "Hello John Doe" printed as expected. Where `pqueue` comes in handy
24+
is when dealing with long running jobs. Since the jobs are queued one can send
25+
in new a job even if the server is still executing an earlier program. All the
26+
jobs are stored in a queue and executed sequentially in first-come, first-served
27+
basis. For example, we can start a new server named "timers":
28+
29+
pqueue server -n timers sleep {}
30+
31+
After this, we can send in a bunch of jobs:
32+
33+
pqueue send -n timers 10
34+
pqueue send -n timers 4
35+
pqueue send -n timers 20
36+
37+
The tasks will execute one after another.
38+
39+
## Dependencies
40+
41+
process-queue uses DBus for IPC and
42+
needs [`libdbus`](https://dbus.freedesktop.org/releases/dbus/) 1.6 or higher.

src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Server {
4141
}
4242

4343
pub fn run(&self) {
44-
info!("starting pqueue server");
44+
info!("starting pqueue server with name \"{}\"", &self.name);
4545
let (sender, receiver) = channel::<Args>();
4646
let name = self.name.clone();
4747
thread::spawn(move || {

0 commit comments

Comments
 (0)