X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f675fb2c202516021b961b5aa2de4528ba9f0d1f..9f1850a385ee8e0a011474de19ee6507b0b168f3:/services/ws/session.go diff --git a/services/ws/session.go b/services/ws/session.go index a0658d964c..c0cfbd6d02 100644 --- a/services/ws/session.go +++ b/services/ws/session.go @@ -1,10 +1,20 @@ -package main +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +package ws + +import ( + "database/sql" + + "git.arvados.org/arvados.git/sdk/go/arvados" +) type session interface { - // Receive processes a message received from the client. If - // the returned list of messages is non-nil, they will be - // queued for sending to the client. - Receive(map[string]interface{}, []byte) [][]byte + // Receive processes a message received from the client. If a + // non-nil error is returned, the connection will be + // terminated. + Receive([]byte) error // Filter returns true if the event should be queued for // sending to the client. It should return as fast as @@ -22,6 +32,6 @@ type session interface { // incoming events will be queued. If the event queue fills // up, the connection will be dropped. EventMessage(*event) ([]byte, error) - - debugLogf(string, ...interface{}) } + +type sessionFactory func(wsConn, chan<- interface{}, *sql.DB, permChecker, *arvados.Client) (session, error)