Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Side by Side Diff: logdog/client/butler/streamserver/streamserver.go

Issue 2737603003: Butler stream servers can generate client address. (Closed)
Patch Set: better comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package streamserver 5 package streamserver
6 6
7 import ( 7 import (
8 "io" 8 "io"
9 9
10 "github.com/luci/luci-go/logdog/client/butlerlib/streamproto" 10 "github.com/luci/luci-go/logdog/client/butlerlib/streamproto"
11 ) 11 )
12 12
13 // StreamServer is an interface to a backgound service that allows external 13 // StreamServer is an interface to a backgound service that allows external
14 // processes to establish Butler streams. 14 // processes to establish Butler streams.
15 type StreamServer interface { 15 type StreamServer interface {
16 // Performs initial connection and setup, entering a listening state. 16 // Performs initial connection and setup, entering a listening state.
17 Listen() error 17 Listen() error
18
19 // Address returns a string that can be used by the "streamclient" packa ge to
20 // return a client for this StreamServer.
21 //
22 // Full package is:
23 // github.com/luci/luci-go/logdog/butlerlib/streamclient
24 //
25 // Address may only be called while the StreamServer is actively listeni ng.
26 Address() string
27
18 // Blocks, returning a new Stream when one is available. If the stream s erver 28 // Blocks, returning a new Stream when one is available. If the stream s erver
19 // has closed, this will return nil. 29 // has closed, this will return nil.
20 Next() (io.ReadCloser, *streamproto.Properties) 30 Next() (io.ReadCloser, *streamproto.Properties)
31
21 // Closes the stream server, cleaning up resources. 32 // Closes the stream server, cleaning up resources.
22 Close() 33 Close()
23 } 34 }
OLDNEW
« no previous file with comments | « logdog/client/butler/streamserver/namedPipe_windows_test.go ('k') | logdog/client/butlerlib/streamclient/client.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698