Commit Graph

222 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire a493114373 Encoding
- `encode()` now uses niknaks
2023-10-02 15:37:45 +02:00
Tristan B. Velloza Kildaire aea8ac5bb6 Encoding
- Switched to niknaks for `decode()`
2023-10-02 15:05:33 +02:00
Tristan B. Velloza Kildaire 440ef79a3a Dub
- Added `niknaks` package with a minimum version of `v0.3.0`
2023-10-02 15:04:59 +02:00
Tristan B. Velloza Kildaire 5cafbb8130 Queue
- Removed `TListener` references

Everything else

- Removed reference to old/duplicate `queue.d` module
2023-10-02 14:43:43 +02:00
Tristan B. Velloza Kildaire be91f5ffc5 Queue
- Removed TODOs which are irrevevant for now
2023-10-02 14:40:44 +02:00
Tristan B. Velloza Kildaire 42c6b111c8
Migrate from libsnooze (#8)
* Dub

- Removed `libsnooze` dependency

* Queue

- Removed `libsnooze` imports

* Queue

- Added mutex+condition variable

* Queue

- Removed old `ensure()` call

* Queue

- Switched one thing over to mutex+condvar

* Queue

- Switched to using condition variable
- Added configurable slumber interval
2023-10-01 20:51:08 +02:00
Tristan B. Velloza Kildaire 761ddb2d1e Merge branch 'master' into nextgen 2023-10-01 19:14:57 +02:00
Tristan B. Velloza Kildaire a23017a747 README
- Added badges
2023-10-01 19:14:16 +02:00
Tristan B. Velloza Kildaire 459f4a8709 Pipelines
- Added code coverage
2023-10-01 19:10:57 +02:00
Tristan B. Velloza Kildaire 7ca6489b58 Dub
- Upgraded `libsnooze` to version `1.3.0-beta`
2023-07-05 13:42:46 +02:00
Tristan B. Velloza Kildaire 4611da0d1d Dub
- Required minimum version of `bformat`, `4.1.0`
2023-06-18 13:40:36 +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 6dd832f807 Exceptions
- Added enum members `DEQUEUE_FAILED` and `ENQUEUE_FAILED` to `ErrorType` enum
2023-06-13 17:50:25 +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 3ff4519d99 Dub
- Now requires a minimum version of `libsnooze` of at least `
1.0.0-beta`
2023-06-13 17:39:05 +02:00
Tristan B. Velloza Kildaire 25775414e1
Merge pull request #7 from deavmi/nextgen_queue_remove
Ability to de-register a queue
2023-05-04 09:51:45 +02:00
Tristan B. Velloza Kildaire bbe7b344ec Merge branch 'nextgen' into nextgen_queue_remove 2023-05-04 09:47:51 +02:00
Tristan B. Velloza Kildaire e0977837af Merge branch 'master' into nextgen 2023-05-04 09:47:39 +02:00
Tristan B. Velloza Kildaire 79432cef6c
Enable CI for `nextgen` branch
- Run CI tests for any pull requests being made to the `nextgen` branch
2023-05-04 09:46:46 +02:00
Tristan B. Velloza Kildaire b283ebcdfc Merge branch 'nextgen' into nextgen_queue_remove 2023-05-04 09:46:15 +02:00
Tristan B. Velloza Kildaire 89fce3bae9 Unit tests
- Added a TODO
2023-05-04 09:45:26 +02:00
Tristan B. Velloza Kildaire 798acba4aa Manager
- Implemented `releaseQueue(Queue)`
- Implemented `releaseQueue_nothrow(Queue)`

Unit tests

- Added unit test for `releaseQueue(Queue)`
2023-05-04 09:45:06 +02:00
Tristan B. Velloza Kildaire abe64f7701 Manager
- Added a TODO for the future `removeQueue(Queue)` and `removeQueu_nothrow(Queue)`
2023-05-03 23:10:45 +02:00
Tristan B. Velloza Kildaire 1437895669
Merge pull request #6 from deavmi/nextgen_river
Bformat+River upgrade
2023-04-30 19:42:09 +02:00
Tristan B. Velloza Kildaire 10e230ea2f Merge branch 'nextgen' into nextgen_river 2023-04-30 19:36:50 +02:00
Tristan B. Velloza Kildaire 8d3534b216 Merge branch 'master' into nextgen 2023-04-30 19:34:27 +02:00
Tristan B. Velloza Kildaire 64163aed0a - Upgraded to new `bformat` version `4.1.0` and migrated to using `BClient` (unit tests seem to pass) 2023-04-30 19:30:11 +02:00
Tristan B. Velloza Kildaire c43ed31ca9
Update README.md 2023-04-30 19:24:24 +02:00
Tristan B. Velloza Kildaire fb36497bda
Create d.yml 2023-04-30 19:23:22 +02:00
Tristan B. Velloza Kildaire 97ecbd86bb Watcher
- Documented method `shutdown()`
2023-04-07 12:27:14 +02:00
Tristan B. Velloza Kildaire b10807e279 Package
- Removed whitespace
2023-04-07 12:23:35 +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 6e972b6cc5 Watcher
- Documented module `tristanable.manager.watcher`
2023-04-07 12:19:19 +02:00
Tristan B. Velloza Kildaire 97e72e09f0 Watcher
- Added documentation to the constructor for `Watcher`
2023-04-07 12:18:20 +02:00
Tristan B. Velloza Kildaire 1b6dd5d746 Manager
- Removed now-completed TODO
- Added documentation for `queuesLock`
2023-04-07 12:16:52 +02:00
Tristan B. Velloza Kildaire b7bb3df7c9 Manager
- Added documentation for `start()` and `stop()`
2023-04-07 12:16:13 +02:00
Tristan B. Velloza Kildaire 3bda88267b Exceptions
- Added missing documentation
- Fixed the message generation of the exception's message
2023-04-07 12:14:02 +02:00
Tristan B. Velloza Kildaire 07d47551ae Exceptions
- Documented `ErrorType` and all its members
- Documented `TristanableException`
2023-04-06 15:46:34 +02:00
Tristan B. Velloza Kildaire 79fee5bd7e Watcher
- Documented unittest as it is a great example of how to sue tristanable
2023-04-06 13:40:38 +02:00
Tristan B. Velloza Kildaire f811273818 Unit test
- Sleep a little longer for profiling tests
2023-04-06 13:18:20 +02:00
Tristan B. Velloza Kildaire 375a611a82 Watcher
- Added package-level accessible `startWatcher()` method which calls `start()` for us
- Added some debugging prints which will now only be compiled-in during unittest builds
- If the bformat `receiveMessage(Socket, ref byte[])` method fails (returns `false`) then exit the loop, only continue decoding if it is `true`
- Implemented package-level accesible `shutdown()` method

Manager

- `start()` now calls `watcher.startWatcher()` instead of `watcher.start()`
2023-04-06 13:13:38 +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 62b16de596 Watcher
- Added stub `shutdown()` method that is intended to be called by `Manager` (package-level accessible)

Unit tests

- Sleep for 4 seconds instead of 2 before the server sends the two tagged messages
- Send a messae tagged with tag `42` before that of the one tagged with `69`
- Register a queue with tag `42`
- Remove `WaitingThread`, we now receive both tagged messages (`42` and `69`) on the unittest thread
- Added assertion to ensure the tagged message of `69` is indeed received correctly (tag AND payload)
2023-04-06 08:57:52 +02:00
Tristan B. Velloza Kildaire 9f07c06e15 Package (`manager`)
- Import the `Config` type and the `defaultConfig()` function
2023-04-06 08:51:47 +02:00
Tristan B. Velloza Kildaire 26e856b7a1 Manager
- Added support for configuring the `Manager`, the constructor now uses the default configuration
- Implemented `registerQueue_nothrow(Queue)` which returns `true` on success, `false` otherwise
- `registerQueue(Queue)` now makes a sub-call to `registerQueue_nothrow(Queue)`
- Implemented `sendMessage(TaggedMessage)`
- Added comment for assertions in unittest
2023-04-06 08:51:32 +02:00
Tristan B. Velloza Kildaire 62cc615be3 Config
- Make the default configuration generated more explicit in `defaultConfig`
- Remove initialization in `Config` (would be `false` in any case)
2023-04-06 08:49:44 +02:00
Tristan B. Velloza Kildaire af4eed748f Config
- Added new module `config`
- Added new type `Config` which is used for configuring an instance of `Manager`
- Added `defaultConfig()` which returns the default `Config` instance used
2023-04-06 08:49:02 +02:00
Tristan B. Velloza Kildaire 4632929123 Manager
- Removed empty unittest
2023-04-06 08:29:30 +02:00
Tristan B. Velloza Kildaire 6b13303c9d Manager
- Added unittest for `getUniqueQueue()`
- Typo fix
2023-04-06 08:26:01 +02:00
Tristan B. Velloza Kildaire 63698c0f87 Manager
- Implemented `getUniqueQueue()` which finds an unused tag, makes a `Queue` with said tag, registers it and then returns it
- WIP: `shutdown()` method
2023-04-05 15:35:55 +02:00