mirror of
https://github.com/deavmi/tristanable.git
synced 2024-09-22 06:22:54 +02:00
38 lines
813 B
D
38 lines
813 B
D
module tristanable.watcher;
|
|
|
|
import tristanable.manager : Manager;
|
|
import std.socket : Socket;
|
|
import core.thread : Thread;
|
|
import bmessage : receiveMessage;
|
|
|
|
/* 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)
|
|
{
|
|
super(&watchLoop);
|
|
this.manager = manager;
|
|
this.endpoint = endpoint;
|
|
}
|
|
|
|
private void watchLoop()
|
|
{
|
|
while(true)
|
|
{
|
|
/* TODO: Loop here */
|
|
}
|
|
}
|
|
} |