Added constructors to types `Manager` and `Watcher`
This commit is contained in:
parent
23c4e85134
commit
647b86f3c2
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue