mirror of
https://github.com/MontFerret/ferret.git
synced 2025-03-19 21:28:32 +02:00
* Added new WAITFOR syntax * Added support of event options * Added support of options * Added support of using WAITFOR EVENT in variable assignment
23 lines
531 B
Go
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
|
|
}
|
|
)
|