예제 #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
}
예제 #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)
}
예제 #3
0
// NewPoolSynchronizer initializes a new Synchronizer
func NewPoolSynchronizer(handler PoolSyncHandler, getConnection zzk.GetConnection) *zzk.Synchronizer {
	pSync := &PoolSynchronizer{handler, getConnection}
	return zzk.NewSynchronizer(pSync)
}
예제 #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)
}