Documentation ¶
Overview ¶
Package gobench implements alternative controller for benchmarking Go server w/o RPC. Mimics BenchmarkChannel from https://github.com/palkan/websocket-shootout/blob/master/ruby/action-cable-server/app/channels/benchmark_channel.rb
Index ¶
- type BroadcastMessage
- type Controller
- func (c *Controller) Authenticate(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
- func (c *Controller) Disconnect(sid string, env *common.SessionEnv, id string, subscriptions []string) error
- func (c *Controller) Perform(sid string, env *common.SessionEnv, id string, channel string, data string) (res *common.CommandResult, err error)
- func (c *Controller) Shutdown() error
- func (c *Controller) Start() error
- func (c *Controller) Subscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
- func (c *Controller) Unsubscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
- type Identifiers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastMessage ¶
BroadcastMessage represents a pubsub payload
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller implements node.Controller interface for gRPC
func NewController ¶
func NewController(metrics *metrics.Metrics, logger *slog.Logger) *Controller
NewController builds new Controller from config
func (*Controller) Authenticate ¶
func (c *Controller) Authenticate(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
Authenticate allows everyone to connect and returns welcome message and rendom ID as identifier
func (*Controller) Disconnect ¶
func (c *Controller) Disconnect(sid string, env *common.SessionEnv, id string, subscriptions []string) error
Disconnect performs disconnect RPC call
func (*Controller) Perform ¶
func (c *Controller) Perform(sid string, env *common.SessionEnv, id string, channel string, data string) (res *common.CommandResult, err error)
Perform performs Command RPC call with "perform" command
func (*Controller) Subscribe ¶
func (c *Controller) Subscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
Subscribe performs Command RPC call with "subscribe" command
func (*Controller) Unsubscribe ¶
func (c *Controller) Unsubscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
Unsubscribe performs Command RPC call with "unsubscribe" command
type Identifiers ¶
type Identifiers struct {
ID string `json:"id"`
}
Identifiers represents a connection identifiers