Added SetTimeout back to Thread

graph-rework-2
noah metz 2023-07-02 12:23:35 -06:00
parent 6355cc4226
commit 8d041fa896
1 changed files with 3 additions and 2 deletions

@ -334,6 +334,7 @@ type Thread interface {
Action(action string) (ThreadAction, bool)
Handler(signal_type string) (ThreadHandler, bool)
SetTimeout(end time.Time)
Timeout() <-chan time.Time
ClearTimeout()
@ -516,8 +517,8 @@ func (thread * BaseThread) ClearTimeout() {
thread.timeout_chan = nil
}
func (thread * BaseThread) SetTimeout(timeout time.Time) {
thread.timeout_chan = time.After(time.Until(timeout))
func (thread * BaseThread) SetTimeout(end time.Time) {
thread.timeout_chan = time.After(time.Until(end))
}
var ThreadDefaultStart = func(ctx * GraphContext, thread Thread) (string, error) {