X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d6b6b39bfe67926490506125c88f3567e45e7dcc..58ed4ee31a1e2c18e991065ab4f7c4bd2371e563:/services/ws/session.go diff --git a/services/ws/session.go b/services/ws/session.go index 9111c6cc28..67f460865c 100644 --- a/services/ws/session.go +++ b/services/ws/session.go @@ -1,10 +1,16 @@ package main +import ( + "database/sql" + + "git.curoverse.com/arvados.git/sdk/go/arvados" +) + type session interface { - // Receive processes a message received from the client. If - // the returned response is non-nil, it will be queued and - // sent 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 +28,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)