X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d3a6d626ab4534865a14e8a34295a65e92036f37..b20770d7e5a4ba0a974a7b98fce87b81aead95d9:/services/ws/session.go diff --git a/services/ws/session.go b/services/ws/session.go index d148f59128..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 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 @@ -23,3 +29,5 @@ type session interface { // up, the connection will be dropped. EventMessage(*event) ([]byte, error) } + +type sessionFactory func(wsConn, chan<- interface{}, *sql.DB, permChecker, *arvados.Client) (session, error)