mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-02-14 12:19:19 -06:00
* initial commit * init readme * add gem-release * tests * lock file * init examples * bundle name * feat: config * example * wip * init api * fix patch * fix patch * wip events feature * runs client * complete feature clients * modern style * cleanup * rm generated * since * fix examples * tests * alpha * rest * rm rest * fix: pre-commit --------- Co-authored-by: mrkaye97 <mrkaye97@gmail.com>
31 lines
560 B
Ruby
31 lines
560 B
Ruby
#!/usr/bin/env ruby
|
|
|
|
require 'hatchet-sdk'
|
|
# require_relative '../src/lib/hatchet-sdk'
|
|
|
|
# Initialize the Hatchet client
|
|
hatchet = Hatchet::Client.new()
|
|
|
|
result = hatchet.events.create(
|
|
key: "test-event",
|
|
data: {
|
|
message: "test"
|
|
}
|
|
)
|
|
puts "Event created: #{result.inspect}"
|
|
|
|
|
|
run = hatchet.runs.create(
|
|
name: "simple",
|
|
input: {
|
|
Message: "test workflow run"
|
|
},
|
|
)
|
|
|
|
puts "TriggeredRun ID: #{run.metadata.id}"
|
|
|
|
result = hatchet.runs.poll(run.metadata.id)
|
|
|
|
puts "Runs client initialized: #{result.inspect}"
|
|
puts "Run status: #{result.run.status}"
|