initial commit

This commit is contained in:
Timur Gordon
2025-08-26 14:47:52 +02:00
commit 010ecc7c71
18 changed files with 1543 additions and 0 deletions

34
examples/runner.vsh Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run
import time
import freeflowuniverse.herolib.baobab.runner
import freeflowuniverse.herolib.core.redisclient
const namespace = ''
mut r := &runner.Runner{
name: 'test_runner'
redis_conn: redisclient.new('127.0.0.1:6379')!
}
spawn r.run()
// job := runner.Job{
// id: 'test_job_1'
// caller_id: 'test_caller'
// context_id: 'test_context_1'
// runner: 'test_runner'
// executor: 'tmux.session1'
// payload: 'sleep 10\necho "Hello from job 1"\nsleep 10'
// status: .dispatched
// timeout: 30
// created_at: time.now()
// updated_at: time.now()
// }
// mut redis_conn := redisclient.new('127.0.0.1:6379')!
// job.store_in_redis(mut redis_conn, namespace)!
// mut runner_q := redis_conn.queue_get(r.queue_key()!)
// runner_q.add(job.id)!
for {}