Skip to content

Commit

Permalink
rename oneway dispatcher, fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
peats-bond committed Dec 6, 2016
1 parent 90c5a53 commit 406f846
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/crossdock/client/dispatcher/dispatcher.go
Expand Up @@ -76,9 +76,9 @@ func Create(t crossdock.T) yarpc.Dispatcher {
})
}

// CreateOneway returns a started dispatcher and returns the address the
// CreateOnewayDispatcher returns a started dispatcher and returns the address the
// server should call back to (ie this host)
func CreateOneway(t crossdock.T, handler raw.OnewayHandler) (yarpc.Dispatcher, string) {
func CreateOnewayDispatcher(t crossdock.T, handler raw.OnewayHandler) (yarpc.Dispatcher, string) {
fatals := crossdock.Fatals(t)

server := t.Param("server_oneway")
Expand Down
2 changes: 1 addition & 1 deletion internal/crossdock/client/dispatcher/dispatcher_test.go
Expand Up @@ -103,7 +103,7 @@ func TestCreateOneway(t *testing.T) {

for _, tt := range tests {
entries := crossdock.Run(tt.params, func(ct crossdock.T) {
dispatcher, callBackAddr := CreateOneway(ct, nil)
dispatcher, callBackAddr := CreateOnewayDispatcher(ct, nil)

// should get here only if the request succeeded
clientConfig := dispatcher.ClientConfig("yarpc-test")
Expand Down
5 changes: 2 additions & 3 deletions internal/crossdock/client/oneway/oneway.go
Expand Up @@ -35,7 +35,7 @@ import (
// Run starts the oneway behavior, testing a combination of encodings and transports
func Run(t crossdock.T) {
callBackHandler, serverCalledBack := newCallBackHandler()
dispatcher, callBackAddr := dispatcher.CreateOneway(t, callBackHandler)
dispatcher, callBackAddr := dispatcher.CreateOnewayDispatcher(t, callBackHandler)
defer dispatcher.Stop()

encoding := t.Param(params.Encoding)
Expand All @@ -51,8 +51,7 @@ func Run(t crossdock.T) {
}
}

// newCallBackHandler creates a oneway handler that fills a channel
// with the received body
// newCallBackHandler creates a oneway handler that fills a channel with the body
func newCallBackHandler() (raw.OnewayHandler, <-chan []byte) {
serverCalledBack := make(chan []byte)
handler := func(ctx context.Context, reqMeta yarpc.ReqMeta, body []byte) error {
Expand Down

0 comments on commit 406f846

Please sign in to comment.