tristanable ~reserved_tags
Tag-based asynchronous messaging framework
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
tristanable
Tag-based asynchronous messaging framework
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):
Manager manager = new Manager(socket);
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
:
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:
byte[] receivedData = manager.receiveMessage(1);
byte[] receivedData = manager.receiveMessage(2);
TODO
Format
[4 bytes (size-2, little endian)][8 bytes - tag][(2-size) bytes - data]
Acknowledgements
Thansk to Gabby Smuts for the name suggestion 😉️
- Registered by Tristan B. Velloza Kildaire
- ~reserved_tags released 4 years ago
- deavmi/tristanable
- LGPL-3.0
- Copyright © 2020, Tristan B. Kildaire
- Authors:
- Dependencies:
- bformat
- Versions:
-
4.1.2-beta 2023-Oct-02 4.1.1-beta 2023-Oct-02 4.1.0-beta 2023-Oct-02 4.0.2-beta 2023-Oct-02 4.0.1-beta 2023-Oct-02 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
467 downloads total
-
- Score:
- 0.2
- Short URL:
- tristanable.dub.pm