Ejemplo n.º 1
0
func (d *Daemon) clientService(data eventual2go.Data) {
	m := data.(NewService)
	d.logger.Println("new service", m)
	a := service.NewAnnouncer(m.UUID, m.Addresses, m.ServiceType, m.Descriptor)
	client := d.clients[m.UUID]
	a.ServiceArrived().Listen(serviceArrived(client))
	a.ServiceGone().Listen(serviceGone(client))
	a.Run()
	d.announcer[m.UUID] = a
}
Ejemplo n.º 2
0
func (d *Daemon) clientService(data eventual2go.Data) {
	m := data.(NewService)
	d.logger.Printf("new service %v", m)
	defer func() {
		if r := recover(); r != nil {
			d.logger.Println("insane descriptor, aborting", r)
			return
		}
	}()
	desc := servicedescriptor.FromYaml(m.Descriptor)
	d.logger.Printf("tagset is %v", desc.AsTagSet())
	cfg := config.DebugLocalhost()
	cfg.NetworkInterfaces = m.Addresses
	a := service.NewAnnouncer(m.UUID, m.ServiceType, desc, cfg, m.Ports)
	client := d.clients[m.UUID]
	a.ServiceArrived().Listen(serviceArrived(client))
	a.ServiceGone().Listen(serviceGone(client))
	a.Run()
	d.announcer[m.UUID] = a
}