Commit Graph

211 Commits

Author SHA1 Message Date
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 0d94ed0c83 Exceptions
- Added new member `NO_DEFAULT_QUEUE` to enum `ErrorType`
2023-03-30 13:33:17 +02:00
Tristan B. Velloza Kildaire 06e80eec84 Manager
- Documented `registerQueue(Queue)`
2023-03-30 12:36:52 +02:00
Tristan B. Velloza Kildaire ab07df80ea Manager
- Removed now-completed TODO in `registerQueue(QUeue)`
2023-03-30 12:35:41 +02:00
Tristan B. Velloza Kildaire a13ff17c0d Package (tristanable)
- Fixed up the `exceptions` module import
2023-03-29 16:04:51 +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 454e7dd18e Watcher
- Moved TODO below already completed code

Exceptions

- Renamed `Error` to `ErrorType`
- Constructing a new `TristanableException` will now store the passed in `ErrorType`
- Added `getError()` to `TristanableException` which returns the stored `ErrorType`
- Added two new memebrs to enum `ErrorType`, namely `QUEUE_NOT_FOUND` and `QUEUE_ALREADY_EXISTS`
2023-03-29 15:57:51 +02:00
Tristan B. Velloza Kildaire 8942bd7f85 Watcher
- Added import for `bformat` and `encoding` module
- Documented `watch()`
- Added `bformat` read-and-decode `receiveMessage(Socket, ref byte[])` call followed by a `TaggedMessage.decode(byte[])` call
2023-03-27 21:58:04 +02:00
Tristan B. Velloza Kildaire e1676e2acc - Fixed formatting in `README.md` 2023-03-27 16:21:37 +02:00
Tristan B. Velloza Kildaire 6b04a0325a TaggedMessage
- Added documentation for fields `tag` and `data`
- Added documentation for both constructors
- Added documentation for `getPayload()`, `getTag()`, `setPayload(byte[])` and `setTag(ulong)`
2023-03-27 16:20:26 +02:00
Tristan B. Velloza Kildaire cd0eed6dda Encoding
- Added parameter-less (default) constructor marked as `private` to `TaggedMessage`
- Added decoding support in `decode(byte[])` which will return a new instance of `TaggedMessage`
- Added a unit test to test encoding and decoding
2023-03-27 16:02:39 +02:00
Tristan B. Velloza Kildaire ef95b15a2d Merge branch 'nextgen' of github.com:deavmi/tristanable into nextgen 2023-03-27 15:43:10 +02:00
Tristan B. Velloza Kildaire f75604eca9 - Attempt merge 2023-03-27 15:41:50 +02:00
Tristan B. Velloza Kildaire 83b2a11c80 Encoding
- Added stub class `TaggedMessage`
- Added constructor, static decoder (unimplemented), `encoder (implemented), getters and setters
- Added module `tristanable.encoding`
2023-03-27 15:40:20 +02:00
Tristan B. Velloza Kildaire f36a6ba454 Package (tristanable)
- Added an import for `TaggedMessage` from module `tristanable.encoding`
2023-03-26 18:37:22 +02:00
Tristan B. Velloza Kildaire a05bc3e2fd Manager
- Added stub `sendMessage(TaggedMessage)` which will encode into the tristanable format, then wrap into bformat and send over the socket
- Added import for `TaggedMessage` from `tristanable.encoding` module
2023-03-26 18:35:19 +02:00
Tristan B. Velloza Kildaire ed68bf7cd6 - Moved `Watcher` and `Manager` modules to their own package
- Ensured `Watcher`'s constructor is package-level accessible only

Manager

- The constructor now creates an instance of `Watcher`
- Added a `start()` method which calls `watcher.start()`
2023-03-26 18:31:52 +02:00
Tristan B. Velloza Kildaire 88432ab8d5 Manager
- Added unit test TODO
2023-03-26 18:27:24 +02:00
Tristan B. Velloza Kildaire 0d740d6231 Watcher
- Added constructor which takes in an instance of `Manager` and an instance of `Socket`
2023-03-26 18:26:07 +02:00
Tristan B. Velloza Kildaire 80d870e41a Manager
- Added field `watcher` of type `Watcher`
2023-03-26 18:24:15 +02:00
Tristan B. Velloza Kildaire de44080c6b Package (tristanable)
- Added public imports along with comments per each

Encoding

- Added a stub class, `TaggedMessage`, for encoding and decoding the tristanable byte payload

Exceptions

- Added `TristanableException` exception type along with the `Error` enum sub-type

Manager

- Added stub code for `Manager` to manage the queues and socket

Queue

- Added stub class representing a queue with a tag (`Queue`)

QueueItem

- Added stub class `QueueItem` which represents an item that is enqueued/dequeued onto a `Queue`

Watcher

- Added stub class `Watcher` which will manage the socket reading-wise
2023-03-26 18:22:15 +02:00
Tristan B. Velloza Kildaire e8454d61df - Use `https` link rather to `bformat` homepage 2023-03-26 16:49:41 +02:00
Tristan B. Velloza Kildaire a3c8b9dd9d - Updated `.gitignore` 2023-03-26 16:21:04 +02:00
Tristan B. Velloza Kildaire 4dd4199f20 - Removed executable 2023-03-26 16:20:39 +02:00
Tristan B. Velloza Kildaire a935aa65dd - Added `bformat` version `3.1.13` as dependency 2023-03-26 12:20:21 +02:00
Tristan B. Velloza Kildaire 6ea030301c - Added new logo to `README.md`
- Fixed typos in `README.md`
- Added new logo (source included)
2023-03-26 12:19:56 +02:00
Tristan B. Velloza Kildaire 153512e9ab Dub
- Upgraded `libsnooze` to version `0.3.3`
2023-03-19 18:06:37 +02:00
Tristan B. Velloza Kildaire 01a5d779c8 Package
- Added a title to the documentation to better describe what this library does

Dub

- Updated package description
- Added project website link
2023-03-03 17:49:32 +02:00
Tristan B. Velloza Kildaire f8aa3b92cf Package
- Added imports that should be publically imported (exported into the user)
2023-03-03 17:47:23 +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 cf431bdac9 - Updated author's name in package details 2023-02-26 21:55:38 +02:00
Tristan B. Velloza Kildaire 17da826d07 Restarting project 2023-02-26 21:55:13 +02:00
Tristan B. Velloza Kildaire 586835a627 Removed this bitch ass hoe 2022-03-19 13:51:31 +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 ad99ef63d9 Added TODO 2021-09-09 16:18:16 +02:00
Tristan B. Velloza Kildaire b58fb718a7 Added some comments 2021-09-09 16:09:27 +02:00
Tristan B. Velloza Kildaire ddd46f3388 Added some comments 2021-09-09 18:02:45 +02:00
Tristan B. Velloza Kildaire df4d479e54 Throw an exception when trying to remove a queue with an id not in use by any queue 2021-09-09 18:01:14 +02:00
Tristan B. Velloza Kildaire 0c43e80cf6 Throw an exception when trying to add a queue with an id already in use by another queue 2021-09-09 18:00:59 +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 9c7d15dc89 corrected last commit 2021-09-08 22:09:48 +02:00
Tristan B. Velloza Kildaire e1c28d9c11 Added `getSocket()` method to the Manager class 2021-09-08 22:08:03 +02:00
Tristan B. Velloza Kildaire b4bf4d5af5 Fixed bug for shutdowns 2021-09-08 20:54:34 +02:00
Tristan B. Velloza Kildaire e5a0a280bc Changed API 2021-09-08 20:50:22 +02:00
Tristan B. Velloza Kildaire b060b30c44 Added `sendMessage` to bformat encode the final t-encoded message 2021-09-08 20:45:39 +02:00
Tristan B. Velloza Kildaire ce3772c66c Reverted 2021-09-08 20:28:14 +02:00
Tristan B. Velloza Kildaire 256c6154cc Test 2021-09-08 20:27:11 +02:00