Added constructors to types `Manager` and `Watcher`

This commit is contained in:
Tristan B. Kildaire 2020-06-21 17:36:43 +02:00
parent 23c4e85134
commit 647b86f3c2
2 changed files with 42 additions and 0 deletions

View File

@ -1,4 +1,22 @@
module tristanable.manager;
import tristanable.watcher : Watcher;
import std.socket : Socket;
/* TODO: Watcher class to watch for stuff, and add to manager's queues */
/* TODO: maneger class to use commands on, enqueue and wait for dequeue */
public final class Manager
{
/* TODO: Insert queues here */
/**
* The associated Watcher object for this manager.
*/
private Watcher watcher;
this(Socket endpoint)
{
/* TODO: Create the watcher */
watcher = new Watcher(this, endpoint);
}
}

View File

@ -1,4 +1,28 @@
module tristanable.watcher;
import tristanable.manager : Manager;
import std.socket : Socket;
import core.thread : Thread;
/* TODO: Watcher class to watch for stuff, and add to manager's queues */
/* TODO: maneger class to use commands on, enqueue and wait for dequeue */
public final class Watcher : Thread
{
/**
* The associated Manager
*
* Used to access the queues.
*/
private Manager manager;
/**
* The endpoint host we are connected to
*/
private Socket endpoint;
this(Manager manager, Socket endpoint)
{
this.manager = manager;
this.endpoint = endpoint;
}
}