I bumped kestrel to version 1.2 this week and there are a few new features:
Queue files are loaded at startup time now, before opening the listening port.
You can explicitly abort an outstanding transcational
GET
by passing the/abort
option (in the same way as/open
or/close
).You can also peek at the current head item on a queue with
/peek
.New options
max_item_size
andsync_journal
.Queues can be deleted with
DELETE
, which just forgets every item and erases any journal file (ie: fast & unrecoverable).Some bugs in stats reporting were fixed.
Hopefully the documentation is much better. There’s a guide now.
Thanks to Clement, Zachary Kim, Blair Zajac, and Frederic Jean for submitting patches!
Special thanks to Justin Azoff, who’s responsible for the coolest new feature: fanout queues. My coworkers had been asking about for this feature for a while, and he posted a branch on github which added them in a way that makes sense to me, so I pulled it in with minor changes. Here’s how they work:
A fanout queue is a “parent” queue that has “children” queues. Whenever an
item is added to the parent, the same item is added automatically to each
child. The children each have their own journal files, and are essentially
independent queues. An item removed from one child doesn’t affect any other
children. In fact, you can even add items directly to a child if you want,
bypassing the fanout. The primary distinction is that SET
s to the parent
are repeated to each child automatically.
A child queue is created automatically by referring to a queue with a +
in
its name. For example, a queue named “orders+audit” is considered to be a
child of the “orders” queue. Once a child is created, it starts receiving new
items immediately, but existing items in the parent are not copied over. (The
child’s history begins now.) Fanout stops when a child is DELETE
d.
Children use the same configuration as their parent, to make things easier. There’s no specific configuration for a child. Also, you can expect fanout queues to use more disk space and memory, since items are being copied around muliple times.
Hopefully the simplicity of the implementation makes it easy to reason about, which I think is more important than having a lot of clever tricks or magic.
Kestrel is, as always, hosted here: http://github.com/robey/kestrel