Commit Graph

31 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire f35441bf57 Queue
- Switched to using condition variable
- Added configurable slumber interval
2023-10-01 20:46:38 +02:00
Tristan B. Velloza Kildaire e13e7c3210 Queue
- Switched one thing over to mutex+condvar
2023-10-01 19:47:51 +02:00
Tristan B. Velloza Kildaire e1e1ed2405 Queue
- Removed old `ensure()` call
2023-10-01 19:45:09 +02:00
Tristan B. Velloza Kildaire 00ef7a34d7 Queue
- Added mutex+condition variable
2023-10-01 19:44:42 +02:00
Tristan B. Velloza Kildaire f46570d343 Queue
- Removed `libsnooze` imports
2023-10-01 19:43:12 +02:00
Tristan B. Velloza Kildaire 628d8444b7 Queue
- `enqueue(TaggedMessage)` can now throw a `TristanableException` if a `FataException` with `libsnooze` occurrs
- `dequeue()` can now throw a `TristanableException` if a `FatalException` occurs during the call to `wait()` on `libsnooze`
2023-06-14 15:23:18 +02:00
Tristan B. Velloza Kildaire ddcad89d00 Queue
- Be specific, catch `FatalException` in `enqueue(TaggedMessage)`
- Be specific, catch `InterruptedException` and `FatalException` seperately
2023-06-13 17:43:39 +02:00
Tristan B. Velloza Kildaire 19742d9276 Queue
- Docuemneted `getId()`
- Documented the `Queue` class
- Documented fields `event`, `queue` and `queueLock`
2023-04-07 12:22:51 +02:00
Tristan B. Velloza Kildaire 2fa77e639f Queue
- Added documentation for the constructor `this(ulong)`
- Fixed issue #5

Unit tests

- The `==` operator on strings does some normalization stuff which results in differing byte sequences and therefore inequality (see the `"Cucumber 😳️"` case), therefore casting to `byte[]`
- Send another message tagged with `69`
- Fixed comment for server code sending tagged `42` message
- Call `manager.stop()` right at the end of the unit test
2023-04-06 12:28:54 +02:00
Tristan B. Velloza Kildaire cf62054eb8 Encoding
- Added module-level documentation

Exceptions

- Added module-level documentation

Queue

- Added module-level documentation

Package (`tristanable.manager`)

- Added module-level documentation
2023-04-05 08:47:51 +02:00
Tristan B. Velloza Kildaire 883949e555 Queue
- Added entrance and exit debugs for `dequeue()`
2023-04-05 08:39:35 +02:00
Tristan B. Velloza Kildaire c2e034715d Queue
- Replaced now-completed TODO with an actual comment in `dequeue()`
2023-04-05 08:33:48 +02:00
Tristan B. Velloza Kildaire eecb9fef02 Queue
- Added imports for `std.stdio` and `to` from `std.conv` to be imported when compiling in `unittest` mode
- Added documentation to `enqueue(TaggedMessage)`
- Implemented `enqueue(TaggedMessage)` using libsnooze
- Added documentation for `dequeue()`
- Implemented `dequeue()` using libsnooze
2023-04-05 08:33:08 +02:00
Tristan B. Velloza Kildaire 4c530dd7cd - Removed `QueueItem` 2023-03-30 13:36:54 +02:00
Tristan B. Velloza Kildaire 409dacd4da Queue
- The actual queue is now an `SList!(TaggedMessage)`
- Added a stub method `enqueue(TaggedMessage)`
- Updated the stub method `dequeue()` which returns a `TaggedMessage` now
2023-03-30 13:35:09 +02:00
Tristan B. Velloza Kildaire 99c14bc699 Manager
- Changed from using D's dynamic arrays for the array of `Queue` objects to using an `SList!(T)` where `T` is the `Queue` type
- Implemented `getQueue(ulong)` which returns the `Queue` object with the matching id/tag, else throws an instance of `TristanabaleException`
- Implemented `registerQueue(Queue)` which will attempt to add the provided `Queue` given that a queue does not already exist with the provided queue's id; if that is the case then an instance of `TristanableException` is thrown

Queue

- Made the constructor take in the `ulong` queue ID
- Made the constructor publically accessible
- Implemented `getID()` which returns the `Queue`'s id as a `ulong`
- Removed the static method `newQueue(ulong)`

Unit test

- Added a unit test to test `getQueue(ulong)` when the queue cannot be found
- Added a unit test to test adding a queue and successfully retrieving it
2023-03-29 16:01:34 +02:00
Tristan B. Velloza Kildaire f75604eca9 - Attempt merge 2023-03-27 15:41:50 +02:00
Tristan B. Velloza Kildaire 8828e3ffdd Manager
- Added an array of `Queue`(s) to the manager

Queue

- Added comments
- Initialize the libsnooze `Event` during construction of the `Queue` type

Dub

- Upgraded libsnooze from `0.2.7` to `0.2.9`

Repository

- Removed `dub.selections.json` file
- Added `dub.selections.json` to the `.gitignore`
2023-03-03 17:44:51 +02:00
Tristan B. Velloza Kildaire e7f93cd78a - Upgraded to working version of `libsnooze` (compilation-wise)
- Fixed imports and missing definitions in `queue` module
2023-02-26 22:24:49 +02:00
Tristan B. Velloza Kildaire 17da826d07 Restarting project 2023-02-26 21:55:13 +02:00
Tristan B. Velloza Kildaire e59dca0c4d this.flags was not set, resulting in the default .init for QueuePolicy being used and enforcing LENGHT_CAPPING by default even when default behaviour should be not to, per the constructors (this()'s) parameters 2022-03-19 13:29:32 +02:00
Tristan B. Velloza Kildaire 26bdcf7d83 Added comment 2021-09-09 11:30:44 +02:00
Tristan B. Velloza Kildaire c241d06ea9 Added `poll()` which lets user check if the queue is empty or not 2021-09-09 11:21:19 +02:00
Tristan B. Velloza Kildaire d9e5e54477 Added some todos for later 2021-09-08 14:29:27 +02:00
Tristan B. Velloza Kildaire 6a00c620ec Cleaned up import 2021-09-08 14:07:56 +02:00
Tristan B. Velloza Kildaire a3ca66db2b Added the ability to set a max length for queues 2021-09-08 14:06:38 +02:00
Tristan B. Velloza Kildaire 3ce8bda7de Clean up 2021-09-08 13:51:28 +02:00
Tristan B. Velloza Kildaire 5f16e8d5b0 Use DList 2021-09-08 11:14:03 +02:00
Tristan B. Kildaire 73322667fa Added missing imports 2020-09-29 19:19:34 +02:00
Tristan B. Kildaire 98d672434a Added missing imports 2020-09-29 19:18:59 +02:00
Tristan B. Kildaire 1f07b06316 WIP: tristanable-ng 2020-09-29 11:57:25 +02:00