mirror of
http://deavmi.assigned.network/git/deavmi/tristanable
synced 2025-02-16 12:56:51 +00:00
New feature: On-receive queuing
In the case where this is enabled, via the Manager constructor's last boolean argument, then any message with a tag that does no match any existing queue will trigger the creation of a new queue with said tag, addition of said queue to the manager and appending of the triggering message to said queue.
This commit is contained in:
parent
0f6a10f012
commit
02f8c8f102
@ -43,18 +43,24 @@ public final class Manager
|
|||||||
private bool isAlive;
|
private bool isAlive;
|
||||||
|
|
||||||
|
|
||||||
|
private bool onRecvQueue;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new Manager with the given
|
* Constructs a new Manager with the given
|
||||||
* endpoint Socket
|
* endpoint Socket
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
this(Socket socket, Duration timeOut = dur!("msecs")(100), bool newSys = false)
|
this(Socket socket, Duration timeOut = dur!("msecs")(100), bool newSys = false, bool onRecvQueue = false)
|
||||||
{
|
{
|
||||||
/* TODO: Make sure the socket is in STREAM mode */
|
/* TODO: Make sure the socket is in STREAM mode */
|
||||||
|
|
||||||
/* Set the socket */
|
/* Set the socket */
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
|
|
||||||
|
/* Set whether this should have on-receive queue funtionality */
|
||||||
|
this.onRecvQueue = onRecvQueue;
|
||||||
|
|
||||||
/* Initialize the queues mutex */
|
/* Initialize the queues mutex */
|
||||||
queuesLock = new Mutex();
|
queuesLock = new Mutex();
|
||||||
|
|
||||||
@ -74,6 +80,11 @@ public final class Manager
|
|||||||
watcher.start();
|
watcher.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool isOnRecvQueue()
|
||||||
|
{
|
||||||
|
return onRecvQueue;
|
||||||
|
}
|
||||||
|
|
||||||
public Queue getQueue(ulong tag)
|
public Queue getQueue(ulong tag)
|
||||||
{
|
{
|
||||||
Queue matchingQueue;
|
Queue matchingQueue;
|
||||||
|
Loading…
Reference in New Issue
Block a user