Files
hatchet/examples/ruby/scheduled/programatic_sync.rb
Gabe Ruttner 7875d78057 Feat: Official Ruby SDK (#3004)
* feat: initial ruby sdk

* fix: run listener

* fix: scope

* feat: rest feature clients

* fix: bugs

* fix: concurrent register

* fix: tests and ergonomics

* docs: all of them

* chore: lint

* feat: add RBS

* feat: add GitHub Actions workflow for Ruby SDK with linting, testing, and publishing steps

* chore: lint

* refactor: simplify load path setup for Hatchet REST client and remove symlink creation

* fix: cert path

* fix: test

* fix: blocking

* fix: ensure Hatchet client is only initialized once across examples

* fix: tests

* remove: unused example

* fix: bubble up errors

* test: skip flaky for now

* remove: lifespans

* fix: durable context bugs

* fix: bulk replay

* fix: tests

* cleanup: generate tooling

* fix: integration test

* chore: lint

* release: 0.1.0

* chore: remove python comments

* refactor: remove OpenTelemetry configuration and related unused options

* fix: default no healthcheck

* chore: lockfile

* feat: register as ruby

* chore: lint

* chore: update py/ts apis to include ruby

* chore: docs pass

* chore: lint

* chore: generate

* chore: cleanup

* chore: generate examples

* tests: add e2e tests

* tests: cache examples dependencies

* fix: namespace

* fix: namespace

* fix: namespaces

* chore:lint

* fix: improve cancellation workflow polling logic and add error handling

* revert: py/ts versions
2026-02-15 14:32:15 -08:00

36 lines
706 B
Ruby

# frozen_string_literal: true
require "hatchet-sdk"
hatchet = Hatchet::Client.new
# > Create
scheduled_run = hatchet.scheduled.create(
workflow_name: "simple-workflow",
trigger_at: Time.now + 10,
input: { "data" => "simple-workflow-data" },
additional_metadata: { "customer_id" => "customer-a" }
)
id = scheduled_run.metadata.id
# > Reschedule
hatchet.scheduled.update(
scheduled_run.metadata.id,
trigger_at: Time.now + 3600
)
# > Delete
hatchet.scheduled.delete(scheduled_run.metadata.id)
# > List
scheduled_runs = hatchet.scheduled.list
# > Bulk delete
hatchet.scheduled.bulk_delete(scheduled_ids: [id])
# > Bulk reschedule
hatchet.scheduled.bulk_update(
[[id, Time.now + 7200]]
)