mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-09-26 18:51:13 +08:00
24 lines
488 B
Go
24 lines
488 B
Go
package plugin_stress
|
|
|
|
import (
|
|
"m7s.live/m7s/v5"
|
|
"m7s.live/m7s/v5/pkg/util"
|
|
"m7s.live/m7s/v5/plugin/stress/pb"
|
|
"sync"
|
|
)
|
|
|
|
type StressPlugin struct {
|
|
pb.UnimplementedApiServer
|
|
m7s.Plugin
|
|
pushers util.Collection[string, *m7s.Pusher]
|
|
pullers util.Collection[string, *m7s.Puller]
|
|
}
|
|
|
|
var _ = m7s.InstallPlugin[StressPlugin](&pb.Api_ServiceDesc, pb.RegisterApiHandler)
|
|
|
|
func (r *StressPlugin) OnInit() error {
|
|
r.pushers.L = &sync.RWMutex{}
|
|
r.pullers.L = &sync.RWMutex{}
|
|
return nil
|
|
}
|