refact(worker): update worker porxy handler signature to return an error (#1536)

Instead of requiring the each proxy handler to handle the webSocket
connection closure.  On error the worker handler will appropriately
close the connection and event any errors.
This commit is contained in:
Louis Ruch authored and GitHub committed 2021-09-17 11:48:44 -07:00
1 parent c82d37bfba
commit 6a92e08928
5 files changed
+28 -39

No files matched your search

+2 -2
View File
@@ -136,7 +136,7 @@ func TestRegisterHandler(t *testing.T) {
t.Parallel()
assert, require := assert.New(t), require.New(t)
fn := func(context.Context, Config, ...Option) { return }
fn := func(context.Context, Config, ...Option) error { return nil }
err := RegisterHandler("protocol", fn)
require.NoError(err)
@@ -154,7 +154,7 @@ func TestGetHandler(t *testing.T) {
t.Parallel()
assert, require := assert.New(t), require.New(t)
fn := func(context.Context, Config, ...Option) {}
fn := func(context.Context, Config, ...Option) error { return nil }
err := RegisterHandler("fn", fn)
require.NoError(err)