Commit Graph

2 Commits

Author SHA1 Message Date
Josh van Leeuwen 77af8ac182
events/loop & slices (#119)
* events/loop & slices

Adds a generic control loop implementation to `event/loop`.

Adds a new `slices` package that provides a generic slice de-duplication
func.

Makes events batcher and queue processer taker in Options.

Allows enqueuing multiple processor items in same func call.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Lint

Signed-off-by: joshvanl <me@joshvanl.dev>

* lint

Signed-off-by: joshvanl <me@joshvanl.dev>

* lint

Signed-off-by: joshvanl <me@joshvanl.dev>

* Elements match

Signed-off-by: joshvanl <me@joshvanl.dev>

* Adds buffer size option to events loop

Signed-off-by: joshvanl <me@joshvanl.dev>

* nit

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2025-04-23 11:28:21 -03:00
Josh van Leeuwen 866002abe6
Adds FIFO concurrent lock & generic concurrent Slice (#107)
* Adds FIFO concurrent lock & generic concurrent Slice

Adds a new concurrency/fifo package which implements a fifo mutex, as
well as a concurrently safe comparable indexed map of fifo mutexes.

Adds a simple generic concurrently safe slice implementation, which can
currently only grow.

Moves the map generic implementations in `/concurrency` to
`/concurrency/cmap`.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Linting

Signed-off-by: joshvanl <me@joshvanl.dev>

* Move concurency/slice.go to concurency/slice/slice.go and add concurency/slice/string.go

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2024-10-15 06:03:26 -07:00