Commit 503b1aa7 authored by Brian Tiger Chow's avatar Brian Tiger Chow

feat(net:service) add SetHandler method

Allows the service to be used through an interface.

NB: If the handler is exposed directly, clients of the service cannot swap out their concrete references and replace them with interfaces
parent 6fa0e215
......@@ -204,3 +204,7 @@ func (s *Service) handleIncomingMessage(ctx context.Context, m msg.NetMessage) {
case <-ctx.Done():
}
}
func (s *Service) SetHandler(h Handler) {
s.Handler = h
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment