Example #1
0
func (s *Server) handleConnectionLost(connID int, cause error) {
	if s.idManager.IsClient(connID) {
		s.idManager.RemoveClient(connID)
	} else { // workerID
		s.idManager.RemoveWorker(connID)
		s.workerProxy.HandleWorkerLost(impl.ToWorkerID(connID))
	}
}
Example #2
0
func (s *Server) handleWorkerDone(workerConnID int, res *bitcoin.Message) {
	partialResult := impl.NewTaskPartialResult(impl.ToWorkerID(workerConnID), res)
	s.workerProxy.HandlePartialResult(partialResult)
}
Example #3
0
func (s *Server) handleWorkerJoin(workerConnID int) {
	s.idManager.AddWorkerIfAbsent(workerConnID)
	s.workerProxy.HandleWorkerJoin(impl.ToWorkerID(workerConnID))
}