Loading CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] ### Fixed - Gracefully close Lua matches when call queue fills up. ## [3.9.0] - 2021-10-29 ### Added Loading server/match_handler.go +3 −0 Original line number Diff line number Diff line Loading @@ -128,10 +128,12 @@ func NewMatchHandler(logger *zap.Logger, config Config, sessionRegistry SessionR state, rateInt, err := core.MatchInit(presenceList, deferMessageFn, params) if err != nil { core.Cancel() core.Cleanup() return nil, err } if state == nil { core.Cancel() core.Cleanup() return nil, errors.New("Match initial state must not be nil") } Loading Loading @@ -178,6 +180,7 @@ func NewMatchHandler(logger *zap.Logger, config Config, sessionRegistry SessionR // Continuously run queued actions until the match stops. go func() { defer core.Cleanup() for { select { case <-mh.stopCh: Loading server/runtime.go +1 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,7 @@ type RuntimeMatchCore interface { HandlerName() string CreateTime() int64 Cancel() Cleanup() } type RuntimeEventFunctions struct { Loading server/runtime_go_match_core.go +2 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,8 @@ func (r *RuntimeGoMatchCore) Cancel() { r.ctxCancelFn() } func (r *RuntimeGoMatchCore) Cleanup() {} func (r *RuntimeGoMatchCore) BroadcastMessage(opCode int64, data []byte, presences []runtime.Presence, sender runtime.Presence, reliable bool) error { if r.stopped.Load() { return ErrMatchStopped Loading server/runtime_javascript_match_core.go +2 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,8 @@ func (rm *RuntimeJavaScriptMatchCore) Cancel() { // TODO: implement cancel } func (rm *RuntimeJavaScriptMatchCore) Cleanup() {} func (rm *RuntimeJavaScriptMatchCore) broadcastMessage(r *goja.Runtime) func(goja.FunctionCall) goja.Value { return func(f goja.FunctionCall) goja.Value { if rm.stopped.Load() { Loading Loading
CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] ### Fixed - Gracefully close Lua matches when call queue fills up. ## [3.9.0] - 2021-10-29 ### Added Loading
server/match_handler.go +3 −0 Original line number Diff line number Diff line Loading @@ -128,10 +128,12 @@ func NewMatchHandler(logger *zap.Logger, config Config, sessionRegistry SessionR state, rateInt, err := core.MatchInit(presenceList, deferMessageFn, params) if err != nil { core.Cancel() core.Cleanup() return nil, err } if state == nil { core.Cancel() core.Cleanup() return nil, errors.New("Match initial state must not be nil") } Loading Loading @@ -178,6 +180,7 @@ func NewMatchHandler(logger *zap.Logger, config Config, sessionRegistry SessionR // Continuously run queued actions until the match stops. go func() { defer core.Cleanup() for { select { case <-mh.stopCh: Loading
server/runtime.go +1 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,7 @@ type RuntimeMatchCore interface { HandlerName() string CreateTime() int64 Cancel() Cleanup() } type RuntimeEventFunctions struct { Loading
server/runtime_go_match_core.go +2 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,8 @@ func (r *RuntimeGoMatchCore) Cancel() { r.ctxCancelFn() } func (r *RuntimeGoMatchCore) Cleanup() {} func (r *RuntimeGoMatchCore) BroadcastMessage(opCode int64, data []byte, presences []runtime.Presence, sender runtime.Presence, reliable bool) error { if r.stopped.Load() { return ErrMatchStopped Loading
server/runtime_javascript_match_core.go +2 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,8 @@ func (rm *RuntimeJavaScriptMatchCore) Cancel() { // TODO: implement cancel } func (rm *RuntimeJavaScriptMatchCore) Cleanup() {} func (rm *RuntimeJavaScriptMatchCore) broadcastMessage(r *goja.Runtime) func(goja.FunctionCall) goja.Value { return func(f goja.FunctionCall) goja.Value { if rm.stopped.Load() { Loading