-
Notifications
You must be signed in to change notification settings - Fork 350
Closed
Labels
area/refinementgood first issueGood for newcomersGood for newcomersquestionFurther information is requestedFurther information is requested
Milestone
Description
Here is the codes of WatchAssignments:
func (s *frontendService) WatchAssignments(req *pb.WatchAssignmentsRequest, stream pb.FrontendService_WatchAssignmentsServer) error {
ctx := stream.Context()
for {
select {
case <-ctx.Done():
return ctx.Err()
default:
sender := func(assignment *pb.Assignment) error {
return stream.Send(&pb.WatchAssignmentsResponse{Assignment: assignment})
}
return doWatchAssignments(ctx, req.GetTicketId(), sender, s.store)
}
}
}
Here is my question: Since the loop will quit in the first loop anyway, what's the meaning of the "for" here?
Metadata
Metadata
Assignees
Labels
area/refinementgood first issueGood for newcomersGood for newcomersquestionFurther information is requestedFurther information is requested