mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
e3120cd7c0
implement task class methods: - Task.new: creates task with block, optional name and priority - Task.current: returns currently running task - Task.list: returns array of all tasks in all queues - Task.pass: yields to other tasks voluntarily - Task.get: finds task by name implement task instance methods: - status: returns task status as symbol (:DORMANT, :READY, etc) - name/name=: get/set task name - priority/priority=: get/set priority with queue re-sorting - suspend/resume: manual task suspension and resumption - terminate: forcibly terminate task and wake joiners - join: wait for task completion the api provides full control over task lifecycle and scheduling from ruby code while maintaining thread safety through irq protection. Co-authored-by: Claude <noreply@anthropic.com>