2024-08-04 08:41:35 -04:00
|
|
|
package sinks
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2024-08-05 18:11:31 -04:00
|
|
|
"dynatron.me/x/stillbox/pkg/calls"
|
2024-11-03 07:19:03 -05:00
|
|
|
"dynatron.me/x/stillbox/pkg/nexus"
|
2024-08-04 08:41:35 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
type NexusSink struct {
|
|
|
|
nexus *nexus.Nexus
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewNexusSink(nexus *nexus.Nexus) *NexusSink {
|
|
|
|
ns := &NexusSink{
|
|
|
|
nexus: nexus,
|
|
|
|
}
|
|
|
|
|
|
|
|
return ns
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ns *NexusSink) SinkType() string {
|
|
|
|
return "nexus"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ns *NexusSink) Call(ctx context.Context, call *calls.Call) error {
|
2024-08-04 10:56:46 -04:00
|
|
|
ns.nexus.BroadcastCall(call)
|
2024-08-04 08:41:35 -04:00
|
|
|
return nil
|
|
|
|
}
|