當前位置: 首頁>>代碼示例>>Golang>>正文


Golang eventual2go.StreamController類代碼示例

本文整理匯總了Golang中github.com/joernweissenborn/eventual2go.StreamController的典型用法代碼示例。如果您正苦於以下問題:Golang StreamController類的具體用法?Golang StreamController怎麽用?Golang StreamController使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了StreamController類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: CallAll

func (i *Import) CallAll(function string, parameter interface{}, s *eventual2go.StreamController) {
	i.logger.Println("CallAll", function)
	req := i.newRequest(function, parameter, messages.ONE2MANY)
	s.Join(i.results.Where(isRes(req.UUID)))
	i.Deliver(req)
	return
}
開發者ID:joernweissenborn,項目名稱:aursir4go,代碼行數:7,代碼來源:import.go

示例2: serviceGone

func serviceGone(client *eventual2go.StreamController) eventual2go.Subscriber {
	return func(d eventual2go.Data) {
		s := d.(service.ServiceGone)
		if !client.Closed().Completed() {
			client.Add(NewServiceGone(s))
		}
	}
}
開發者ID:joernweissenborn,項目名稱:aurarath,代碼行數:8,代碼來源:daemon.go

示例3: announce

func (a *Announcer) announce(eventual2go.Data) {
	a.logger.Println("announcing")
	var results *eventual2go.StreamController
	if a.servicetype == IMPORTING {
		results = eventual2go.NewStreamController()
		c := results.AsChan()
		go a.collectAnnounceResponses(c)
	} else {
		a.announced.Complete(nil)
	}
	a.node.Query(a.servicetype, a.node.UUID, results)
	return
}
開發者ID:joernweissenborn,項目名稱:aurarath,代碼行數:13,代碼來源:announcer.go

示例4: waitForQueryFinish

func waitForQueryFinish(s *eventual2go.StreamController, wg *sync.WaitGroup) {
	wg.Wait()
	s.Close()
}
開發者ID:joernweissenborn,項目名稱:aurarath,代碼行數:4,代碼來源:node.go

示例5: collectResponse

func collectResponse(iface string, resp *serf.QueryResponse, s *eventual2go.StreamController, wg *sync.WaitGroup) {
	for r := range resp.ResponseCh() {
		s.Add(QueryResponseEvent{iface, r})
	}
	wg.Done()
}
開發者ID:joernweissenborn,項目名稱:aurarath,代碼行數:6,代碼來源:node.go

示例6: serviceGone

func serviceGone(client *eventual2go.StreamController) eventual2go.Subscriber {
	return func(d eventual2go.Data) {
		uuid := d.(string)
		client.Add(NewServiceGone(uuid))
	}
}
開發者ID:YamiNoKeshin,項目名稱:aurarath,代碼行數:6,代碼來源:daemon.go

示例7: serviceArrived

func serviceArrived(client *eventual2go.StreamController) eventual2go.Subscriber {
	return func(d eventual2go.Data) {
		sa := d.(service.ServiceArrived)
		client.Add(NewServiceArrived(sa))
	}
}
開發者ID:YamiNoKeshin,項目名稱:aurarath,代碼行數:6,代碼來源:daemon.go

示例8: CallAll

func (i *Import) CallAll(function string, parameter []byte, s *eventual2go.StreamController) {
	i.logger.Println("CallAll", function)
	uuid := i.call(function, parameter, messages.ONE2MANY)
	s.Join(i.results.Where(isRes(uuid)))
	return
}
開發者ID:AurSir,項目名稱:aurarath,代碼行數:6,代碼來源:import.go


注:本文中的github.com/joernweissenborn/eventual2go.StreamController類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。