2024-03-03 16:37:03 -07:00
|
|
|
package graphvent
|
|
|
|
|
2024-03-28 20:28:07 -06:00
|
|
|
type Tag string
|
|
|
|
type Changes []Tag
|
2024-03-03 16:37:03 -07:00
|
|
|
|
|
|
|
// Extensions are data attached to nodes that process signals
|
|
|
|
type Extension interface {
|
|
|
|
// Called to process incoming signals, returning changes and messages to send
|
2024-03-31 00:36:50 -06:00
|
|
|
Process(*Context, *Node, NodeID, Signal) ([]Message, Changes)
|
2024-03-03 16:37:03 -07:00
|
|
|
|
|
|
|
// Called when the node is loaded into a context(creation or move), so extension data can be initialized
|
|
|
|
Load(*Context, *Node) error
|
|
|
|
|
|
|
|
// Called when the node is unloaded from a context(deletion or move), so extension data can be cleaned up
|
|
|
|
Unload(*Context, *Node)
|
|
|
|
}
|