(create-client options)
(create-client options timeout)
Creates a ScheduleClient
instance suitable for interacting with Temporal's Schedules.
Arguments:
options
: Options for configuring the ScheduleClient
(See temporal.client.options/schedule-client-options
and temporal.client.options/stub-options
)timeout
: Connection timeout as a Duration (default: 5s)Creates a `ScheduleClient` instance suitable for interacting with Temporal's Schedules. Arguments: - `options`: Options for configuring the `ScheduleClient` (See [[temporal.client.options/schedule-client-options]] and [[temporal.client.options/stub-options]]) - `timeout`: Connection timeout as a [Duration](https://docs.oracle.com/javase/8/docs/api//java/time/Duration.html) (default: 5s)
(describe client schedule-id)
Describes an existing Temporal Schedule
via a schedule-id
(let [client (create-client {:target "localhost:8080"})]
(describe client "my-schedule")
Describes an existing Temporal `Schedule` via a schedule-id ```clojure (let [client (create-client {:target "localhost:8080"})] (describe client "my-schedule") ```
(execute client schedule-id overlap-policy)
Runs a Temporal Schedule's
workflow execution immediately via a schedule-id
(let [client (create-client {:target "localhost:8080"})]
(execute client "my-schedule" :skip)
Runs a Temporal `Schedule's` workflow execution immediately via a schedule-id ```clojure (let [client (create-client {:target "localhost:8080"})] (execute client "my-schedule" :skip) ```
(pause client schedule-id)
Pauses an existing Temporal Schedule
via a schedule-id
(let [client (create-client {:target "localhost:8080"})]
(pause client "my-schedule")
Pauses an existing Temporal `Schedule` via a schedule-id ```clojure (let [client (create-client {:target "localhost:8080"})] (pause client "my-schedule") ```
(reschedule client schedule-id options)
Updates the current Temporal Schedule
via a schedule-id.
Uses the same options as create asside from :schedule
The ScheduleHandle
takes a unary function object
of the signature:
(ScheduleUpdateInput) -> ScheduleUpdate
(let [client (create-client {:target "localhost:8080"})]
(reschedule client "my-schedule" {:spec {:crons ["1 * * * *"]}})
Updates the current Temporal `Schedule` via a schedule-id. Uses the same options as create asside from `:schedule` The `ScheduleHandle` takes a unary function object of the signature: (ScheduleUpdateInput) -> ScheduleUpdate ```clojure (let [client (create-client {:target "localhost:8080"})] (reschedule client "my-schedule" {:spec {:crons ["1 * * * *"]}}) ```
(schedule client schedule-id options)
Creates a Schedule
with Temporal
Arguments:
client
: [ScheduleClient]https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/client/schedules/ScheduleClient.htmlschedule-id
: The string name of the schedule in Temporal, keeping it consistent with workflow id is a good ideaoptions
: A map containing the :schedule
, :state
, :policy
, :spec
, and :action
option maps for the Schedule
(defworkflow my-workflow
[ctx args]
...)
(let [client (create-client {:target "localhost:8080"})]
(create
client
"my-workflow"
{:schedule {:trigger-immediately? false}
:state {:paused? false}
:policy {:pause-on-failure? true}
:spec {:crons ["0 * * * *"]}
:action {:workflow-type my-workflow
:arguments {:value 1}
:options {:workflow-id "my-workflow"}}}))
Creates a `Schedule` with Temporal Arguments: - `client`: [ScheduleClient]https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/client/schedules/ScheduleClient.html - `schedule-id`: The string name of the schedule in Temporal, keeping it consistent with workflow id is a good idea - `options`: A map containing the `:schedule`, `:state`, `:policy`, `:spec`, and `:action` option maps for the `Schedule` ```clojure (defworkflow my-workflow [ctx args] ...) (let [client (create-client {:target "localhost:8080"})] (create client "my-workflow" {:schedule {:trigger-immediately? false} :state {:paused? false} :policy {:pause-on-failure? true} :spec {:crons ["0 * * * *"]} :action {:workflow-type my-workflow :arguments {:value 1} :options {:workflow-id "my-workflow"}}})) ```
(unpause client schedule-id)
Unpauses an existing Temporal Schedule
via a schedule-id
(let [client (create-client {:target "localhost:8080"})]
(unpause client "my-schedule")
Unpauses an existing Temporal `Schedule` via a schedule-id ```clojure (let [client (create-client {:target "localhost:8080"})] (unpause client "my-schedule") ```
(unschedule client schedule-id)
Deletes a Temporal Schedule
via a schedule-id
(let [client (create-client {:target "localhost:8080"})]
(unschedule client "my-schedule")
Deletes a Temporal `Schedule` via a schedule-id ```clojure (let [client (create-client {:target "localhost:8080"})] (unschedule client "my-schedule") ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close