Liking cljdoc? Tell your friends :D

riemann.time

Clocks and scheduled tasks. Provides functions for getting the current time and running functions (Tasks) at specific times and periods. Includes a threadpool for task execution, controlled by (start!) and (stop!).

Clocks and scheduled tasks. Provides functions for getting the current time
and running functions (Tasks) at specific times and periods. Includes a
threadpool for task execution, controlled by (start!) and (stop!).
raw docstring

after!clj

(after! delay f)

Calls f after delay seconds

Calls f after delay seconds
sourceraw docstring

Deferrablecljprotocol

deferclj

(defer this new-time)

Schedule a task for a new time.

Schedule a task for a new time.
source

every!clj

(every! interval f)
(every! interval delay f)

Calls f every interval seconds, after delay.

Calls f every interval seconds, after delay.
sourceraw docstring

linear-timeclj

source

linear-time-realclj

(linear-time-real)

A current time on a linear scale with no fixed epoch; counts in seconds. Unlike unix-time, which can pause, skip, or flow backwards, advances consistently at (close) to wall clock time.

A current time on a linear scale with no fixed epoch; counts in seconds.
Unlike unix-time, which can pause, skip, or flow backwards, advances
consistently at (close) to wall clock time.
sourceraw docstring

max-task-idclj

source

next-tickclj

(next-tick anchor dt)
(next-tick anchor dt now)

Given a period dt, beginning at some point in time anchor, finds the next tick after time now, such that the next tick is separate from anchor by an exact multiple of dt. If now is omitted, defaults to (unix-time).

Given a period dt, beginning at some point in time anchor, finds the next
tick after time now, such that the next tick is separate from anchor by an
exact multiple of dt. If now is omitted, defaults to (unix-time).
sourceraw docstring

once!clj

(once! t f)

Calls f at t seconds.

Calls f at t seconds.
sourceraw docstring

park-intervalclj

source

poll-task!clj

(poll-task!)

Removes the next task from the queue.

Removes the next task from the queue.
sourceraw docstring

reset-tasks!clj

(reset-tasks!)

Resets the task queue to empty, without triggering side effects.

Resets the task queue to empty, without triggering side effects.
sourceraw docstring

run-tasks!clj

(run-tasks! i)

While running, takes tasks from the queue and executes them when ready. Will park the current thread when no tasks are available.

While running, takes tasks from the queue and executes them when ready. Will
park the current thread when no tasks are available.
sourceraw docstring

runningclj

source

schedule!clj

(schedule! task)

Schedule a task. May awaken a thread from the threadpool to investigate.

Schedule a task. May awaken a thread from the threadpool to investigate.
sourceraw docstring

schedule-sneaky!clj

(schedule-sneaky! task)

Schedules a task. Does not awaken any threads.

Schedules a task. Does *not* awaken any threads.
sourceraw docstring

start!clj

(start!)

Starts the threadpool to execute tasks on the queue automatically.

Starts the threadpool to execute tasks on the queue automatically.
sourceraw docstring

stop!clj

(stop!)

Stops the task threadpool. Waits for threads to exit.

Stops the task threadpool. Waits for threads to exit.
sourceraw docstring

Taskcljprotocol

cancelclj

(cancel task)

Cancel this task.

Cancel this task.

runclj

(run task)

Executes this task.

Executes this task.

succclj

(succ task)

The successive task to this one.

The successive task to this one.
source

task-idclj

(task-id)

Return a new task ID.

Return a new task ID.
sourceraw docstring

tasksclj

Scheduled operations.

Scheduled operations.
sourceraw docstring

thread-countclj

source

threadpoolclj

source

unix-timeclj

source

unix-time-realclj

(unix-time-real)

The current unix epoch time in seconds, taken from System/currentTimeMillis.

The current unix epoch time in seconds, taken from
System/currentTimeMillis.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close