Added more to API docs.
This commit is contained in:
parent
0a74099fa7
commit
7787ffe1fb
13
README.md
13
README.md
|
@ -5,13 +5,22 @@ Tag-based asynchronous messaging framework
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The entry point is via the `Manager` type, so first create an instance as follows (passing the endpoint `Socket` in as `socket` in this example)
|
The entry point is via the `Manager` type, so first create an instance as follows (passing the endpoint `Socket` in as `socket` in this example):
|
||||||
|
|
||||||
```d
|
```d
|
||||||
Manager manager = new Manager(socket);
|
Manager manager = new Manager(socket);
|
||||||
```
|
```
|
||||||
|
|
||||||
Now the event loop would have started.
|
Now the event loop would have started, now we are ready to send out some tagged messages and blocking receive for them!
|
||||||
|
|
||||||
|
Let's send out two messages with tags `1` and `2`:
|
||||||
|
|
||||||
|
```d
|
||||||
|
manager.sendMessage(1, [1,2,3,4,5]);
|
||||||
|
manager.sendMessage(2, [6,7,8,9,0]);
|
||||||
|
```
|
||||||
|
|
||||||
|
Now we can start two seperate threads and wait on them both:
|
||||||
|
|
||||||
**TODO**
|
**TODO**
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue