Esempio n. 1
0
// NewEndpointSynchronizer instiates a new synchronizer for the EndpointRegistry
func NewEndpointSynchronizer(local client.Connection, registry *EndpointRegistry, getRemoteConnection zzk.GetConnection) *zzk.Synchronizer {
	eSync := &KeySynchronizer{local, &registry.registryType, getRemoteConnection}
	sync := zzk.NewSynchronizer(eSync)

	sync.AddListener(func(key string) zzk.Listener {
		iSync := &EndpointSynchronizer{local, registry, key}
		return zzk.NewSynchronizer(iSync)
	})

	return sync
}
Esempio n. 2
0
// NewHostSynchronizer instantiates a new Synchronizer for host data
func NewHostSynchronizer(handler HostSyncHandler, poolID string) *zzk.Synchronizer {
	hSync := &HostSynchronizer{handler, poolID}
	return zzk.NewSynchronizer(hSync)
}
Esempio n. 3
0
// NewPoolSynchronizer initializes a new Synchronizer
func NewPoolSynchronizer(handler PoolSyncHandler, getConnection zzk.GetConnection) *zzk.Synchronizer {
	pSync := &PoolSynchronizer{handler, getConnection}
	return zzk.NewSynchronizer(pSync)
}
Esempio n. 4
0
// NewServiceSynchronizer initializes a new Synchronizer for Service data
func NewServiceSynchronizer(handler ServiceSyncHandler, poolID string) *zzk.Synchronizer {
	sSync := &ServiceSynchronizer{handler, poolID}
	return zzk.NewSynchronizer(sSync)
}