Exemplo n.º 1
0
func (e *EventProducer) Emit(event Event) {
	select {
	case e.c <- event:
	// OK
	default:
		logging.Println("Event buffer full; dropping event.")
	}
}
Exemplo n.º 2
0
func (s *server) configListener(ch chan struct{}) {
	for range ch {
		configReader, err := s.persister.ReadPersistedConfig()

		if err != nil {
			logging.Println("error reading persisted config", err)
			continue
		}

		newConfig, err := config.Unmarshal(configReader)

		if err != nil {
			logging.Println("error reading marshalled config", err)
			continue
		}

		s.createBucketContainer(newConfig)
	}
}