コード例 #1
0
ファイル: heart.go プロジェクト: runcnc/iris
// Creates a new heartbeat mechanism.
func newHeart(o *Overlay) *heartbeat {
	// Initialize a new heartbeat mechanism
	h := &heartbeat{
		owner: o,
	}
	// Insert the internal beater and return
	h.heart = heart.New(config.PastryBeatPeriod, config.PastryKillCount, h)

	return h
}
コード例 #2
0
ファイル: overlay.go プロジェクト: ibmendoza/iris-0.3.2
// Creates a new scribe overlay.
func New(overId string, key *rsa.PrivateKey, app Callback) *Overlay {
	// Create and initialize the overlay
	o := &Overlay{
		app:    app,
		topics: make(map[string]*topic.Topic),
		names:  make(map[string]string),
	}
	o.pastry = pastry.New(overId, key, o)
	o.heart = heart.New(config.ScribeBeatPeriod, config.ScribeKillCount, o)
	return o
}