mirror of https://github.com/docker/docs.git
Implement NopSender (removed by switch to libchan)
Signed-off-by: Solomon Hykes <solomon@docker.com>
This commit is contained in:
parent
189af64caf
commit
7601d49283
|
@ -0,0 +1,30 @@
|
||||||
|
package beam
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/docker/libchan"
|
||||||
|
"io"
|
||||||
|
)
|
||||||
|
|
||||||
|
type NopSender struct{}
|
||||||
|
|
||||||
|
func (s NopSender) Send(msg *Message) (Receiver, error) {
|
||||||
|
return NopReceiver{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s NopSender) Close() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s NopSender) Unwrap() libchan.Sender {
|
||||||
|
return libchan.NopSender{}
|
||||||
|
}
|
||||||
|
|
||||||
|
type NopReceiver struct{}
|
||||||
|
|
||||||
|
func (r NopReceiver) Receive(mode int) (*Message, error) {
|
||||||
|
return nil, io.EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r NopReceiver) Unwrap() libchan.Receiver {
|
||||||
|
return libchan.NopReceiver{}
|
||||||
|
}
|
Loading…
Reference in New Issue