(chime-at
times
f
&
[{:keys [error-handler on-finished] :or {on-finished (fn* [] ())} :as opts}])
Deprecated: use chime.core/chime-at
instead - see the source of this fn for a migration.
Calls f
with the current time at every time in the times
list.
Deprecated: use `chime.core/chime-at` instead - see the source of this fn for a migration. Calls `f` with the current time at every time in the `times` list.
(chime-ch times & [{:keys [ch] :or {ch (a/chan)}}])
Deprecated: use chime.core-async/chime-ch
- see the source of this fn for a migration.
Returns a core.async channel that 'chimes' at every time in the times list. Times that have already passed are ignored.
Arguments: times - (required) Sequence of java.util.Dates, java.time.Instant, java.time.ZonedDateTime or msecs since epoch
ch - (optional) Channel to chime on - defaults to a new unbuffered channel Closing this channel stops the schedule.
Usage:
(let [chimes (chime-ch [(.plusSeconds (Instant/now) -2) ; has already passed, will be ignored. (.plusSeconds (Instant/now) 2) (.plusSeconds (Instant/now) 2)])] (a/<!! (go-loop [] (when-let [msg (<! chimes)] (prn "Chiming at:" msg) (recur)))))
There are extensive usage examples in the README
Deprecated: use `chime.core-async/chime-ch` - see the source of this fn for a migration. Returns a core.async channel that 'chimes' at every time in the times list. Times that have already passed are ignored. Arguments: times - (required) Sequence of java.util.Dates, java.time.Instant, java.time.ZonedDateTime or msecs since epoch ch - (optional) Channel to chime on - defaults to a new unbuffered channel Closing this channel stops the schedule. Usage: (let [chimes (chime-ch [(.plusSeconds (Instant/now) -2) ; has already passed, will be ignored. (.plusSeconds (Instant/now) 2) (.plusSeconds (Instant/now) 2)])] (a/<!! (go-loop [] (when-let [msg (<! chimes)] (prn "Chiming at:" msg) (recur))))) There are extensive usage examples in the README
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close