Added some stub functions.

This commit is contained in:
Tristan B. Kildaire 2020-06-22 20:48:09 +02:00
parent 05718602b3
commit 783070f828
3 changed files with 68 additions and 2 deletions

View File

@ -1,2 +1,4 @@
# tristanable
Tag-based asynchronous messaging framework
tristanable
===========
Tag-based asynchronous messaging framework

View File

@ -1,6 +1,7 @@
module tristanable.manager;
import tristanable.watcher : Watcher;
import tristanable.request : Request;
import std.socket : Socket;
/* 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 */
/**
* The queue of outstanding requests
*/
private Request[] requestQueue;
/**
* The associated Watcher object for this manager.
*/
@ -24,4 +30,24 @@ public final class Manager
/* Start the watcher */
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)
{
}
}

View File

@ -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 */
}
}