Added some stub functions.
This commit is contained in:
parent
05718602b3
commit
783070f828
|
@ -1,2 +1,4 @@
|
||||||
# tristanable
|
tristanable
|
||||||
Tag-based asynchronous messaging framework
|
===========
|
||||||
|
|
||||||
|
Tag-based asynchronous messaging framework
|
|
@ -1,6 +1,7 @@
|
||||||
module tristanable.manager;
|
module tristanable.manager;
|
||||||
|
|
||||||
import tristanable.watcher : Watcher;
|
import tristanable.watcher : Watcher;
|
||||||
|
import tristanable.request : Request;
|
||||||
import std.socket : Socket;
|
import std.socket : Socket;
|
||||||
|
|
||||||
/* TODO: Watcher class to watch for stuff, and add to manager's queues */
|
/* TODO: Watcher class to watch for stuff, and add to manager's queues */
|
||||||
|
@ -9,6 +10,11 @@ public final class Manager
|
||||||
{
|
{
|
||||||
/* TODO: Insert queues here */
|
/* TODO: Insert queues here */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The queue of outstanding requests
|
||||||
|
*/
|
||||||
|
private Request[] requestQueue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The associated Watcher object for this manager.
|
* The associated Watcher object for this manager.
|
||||||
*/
|
*/
|
||||||
|
@ -24,4 +30,24 @@ public final class Manager
|
||||||
/* Start the watcher */
|
/* Start the watcher */
|
||||||
watcher.start();
|
watcher.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendMessage(ulong tag, byte[] data)
|
||||||
|
{
|
||||||
|
/* TODO: Implement me */
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] receiveMessage(ulong tag)
|
||||||
|
{
|
||||||
|
/* TODO: Implement me */
|
||||||
|
}
|
||||||
|
|
||||||
|
public Request[] getQueue()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void enqueue(Request request)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
module tristanable.request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request
|
||||||
|
*
|
||||||
|
* This type represents a placeholder for an
|
||||||
|
* expected response caused by the sending of
|
||||||
|
* an original message with a matching tag.
|
||||||
|
*/
|
||||||
|
public final class Request
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The data received
|
||||||
|
*/
|
||||||
|
private byte[] dataReceived;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not this request has been
|
||||||
|
* fulfilled or not.
|
||||||
|
*/
|
||||||
|
private bool fulfilled;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The tag for this request
|
||||||
|
*/
|
||||||
|
public ulong tag;
|
||||||
|
|
||||||
|
this(ulong tag)
|
||||||
|
{
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public bool isFulfilled()
|
||||||
|
{
|
||||||
|
/* TODO: Implement me */
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue