1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-03-19 21:28:32 +02:00
ferret/pkg/runtime/events/observable.go
Tim Voronov 742bdae0ae
Feature/#263 waitfor event (#590)
* Added new WAITFOR syntax

* Added support of event options

* Added support of options

* Added support of using WAITFOR EVENT in variable assignment
2021-07-13 21:34:22 -04:00

23 lines
531 B
Go

package events
import (
"context"
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/runtime/values"
)
type (
// Event represents an event object that contains either an optional event data
// or error that occurred during an event
Event struct {
Data core.Value
Err error
}
// Observable represents an interface of
// complex types that can have event subscribers.
Observable interface {
Subscribe(ctx context.Context, eventName string, options *values.Object) <-chan Event
}
)