Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally create restartable tailers. #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/qbits/tape/tailer.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
`poll-interval` will set the wait interval the tailer will apply
when used in a reducible or seq context only when there are no new
message ready to be consumed.
`tailer-id` can be passed for restartable tailers.

clojure.datafy/datafy can be called on the tailer to get associated data

Expand All @@ -40,9 +41,13 @@
https://github.com/OpenHFT/Chronicle-Queue#how-does-chronicle-queue-work"
([queue]
(make queue nil))
([queue {:keys [poll-interval]
([queue {:keys [poll-interval
tailer-id]
:or {poll-interval 50}}]
(let [^ExcerptTailer tailer (.createTailer (q/underlying-queue queue))
(let [^ExcerptTailer tailer
(if tailer-id
(.createTailer (q/underlying-queue queue) tailer-id)
(.createTailer (q/underlying-queue queue)))
codec (q/codec queue)]
(reify
ITailer
Expand Down