Skip to content

Commit

Permalink
broker: simplify run
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Oct 16, 2017
1 parent eab1e08 commit e738825
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,34 +99,25 @@ func (b *Broker) Run(ctx context.Context, requestc <-chan jocko.Request, respons
switch req := request.Request.(type) {
case *protocol.APIVersionsRequest:
resp = b.handleAPIVersions(header, req)
goto respond
case *protocol.ProduceRequest:
resp = b.handleProduce(header, req)
goto respond
case *protocol.FetchRequest:
resp = b.handleFetch(header, req)
goto respond
case *protocol.OffsetsRequest:
resp = b.handleOffsets(header, req)
goto respond
case *protocol.MetadataRequest:
resp = b.handleMetadata(header, req)
goto respond
case *protocol.CreateTopicRequests:
resp = b.handleCreateTopic(header, req)
goto respond
case *protocol.DeleteTopicsRequest:
resp = b.handleDeleteTopics(header, req)
goto respond
case *protocol.LeaderAndISRRequest:
resp = b.handleLeaderAndISR(header, req)
goto respond
}
case <-ctx.Done():
return
}

respond:
responsec <- jocko.Response{Conn: conn, Header: header, Response: &protocol.Response{
CorrelationID: header.CorrelationID,
Body: resp,
Expand Down

0 comments on commit e738825

Please sign in to comment.