1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-20 06:03:29 +02:00
- Added imports
- Added a receive queue with a corresponding mutex
- Added a field to hold the associated `Client` object

Send

- Added imports
- Added a send queue with a corresponding mutex
- Added a field to hold the associated `Client` object
This commit is contained in:
Tristan B. Velloza Kildaire 2023-03-08 22:06:23 +02:00
parent 8a9f48a3c7
commit a999482fc9
2 changed files with 32 additions and 0 deletions

View File

@ -2,16 +2,32 @@ module birchwood.client.receiver;
import core.thread : Thread; import core.thread : Thread;
import std.container.slist : SList;
import core.sync.mutex : Mutex;
// TODO: Examine the below import which seemingly fixes stuff for libsnooze // TODO: Examine the below import which seemingly fixes stuff for libsnooze
import libsnooze.clib; import libsnooze.clib;
import libsnooze; import libsnooze;
import birchwood.client.core : Client;
public final class ReceiverThread : Thread public final class ReceiverThread : Thread
{ {
/**
* The receive queue and its lock
*/
private SList!(ubyte[]) recvQueue;
private Mutex recvQueueLock;
/** /**
* The libsnooze event to await on which * The libsnooze event to await on which
* when we wake up signals a new message * when we wake up signals a new message
* to be processed and received * to be processed and received
*/ */
private Event receiveEvent; private Event receiveEvent;
/**
* The associated IRC client
*/
private Client client;
} }

View File

@ -2,16 +2,32 @@ module birchwood.client.sender;
import core.thread : Thread; import core.thread : Thread;
import std.container.slist : SList;
import core.sync.mutex : Mutex;
// TODO: Examine the below import which seemingly fixes stuff for libsnooze // TODO: Examine the below import which seemingly fixes stuff for libsnooze
import libsnooze.clib; import libsnooze.clib;
import libsnooze; import libsnooze;
import birchwood.client.core : Client;
public final class SenderThread : Thread public final class SenderThread : Thread
{ {
/**
* The send queue and its lock
*/
private SList!(ubyte[]) sendQueue;
private Mutex sendQueueLock;
/** /**
* The libsnooze event to await on which * The libsnooze event to await on which
* when we wake up signals a new message * when we wake up signals a new message
* to be processed and sent * to be processed and sent
*/ */
private Event receiveEvent; private Event receiveEvent;
/**
* The associated IRC client
*/
private Client client;
} }