Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cgaebel/cloq

A queue of unboxed closures.
https://github.com/cgaebel/cloq

Last synced: about 1 month ago
JSON representation

A queue of unboxed closures.

Awesome Lists containing this project

README

        

CloQ
====

Have you ever wanted to express the idea of "I want to run this piece of code later" in rust?
Unless you `Box` your closures, it's very hard to create architectures based on scheduling
work to be executed later. `CloQ` fixes this.

A `CloQ` is a queue of unboxed closures. It's a great basic abstraction around work queues,
and take an amortized ~10 ns to push and ~10 ns to pop on my machine. This also allows you to
avoid allocating your closures on the heap. The stack-allocated, unboxed closure will be copied
into an internal buffer when pushed, and never copied out.

Please check out the rustdoc (`cargo doc` after cloning) for more information.