func (registry *streamRegistry) RegisterWildcardProducer(producers ...Producer) {
nextProd:
	for _, prod := range producers {
		for _, existing := range registry.wildcard {
			if existing == prod {
				continue nextProd
			}
		}
		registry.wildcard = append(registry.wildcard, prod)
	}
}
RegisterWildcardProducer adds a new producer to the list of known wildcard
prodcuers. This list has to be added to new routers upon creation to send
messages to producers listening to *.
Duplicates will be filtered.
This state of this list is undefined during the configuration phase.
package core
import (
	"hash/fnv"
	"sync"
	"github.com/sirupsen/logrus"
)
var (
	GeneratedRouterPrefix = "_GENERATED_"
)
type streamRegistry struct {
	routers     map[MessageStreamID]Router
	name        map[MessageStreamID]string
	nameGuard   *sync.RWMutex
	streamGuard *sync.RWMutex
	wildcard    []Producer
}
var StreamRegistry = streamRegistry{
	routers:     make(map[MessageStreamID]Router),
	streamGuard: new(sync.RWMutex),
	name:        make(map[MessageStreamID]string),
	nameGuard:   new(sync.RWMutex),
}
func GetStreamID(stream string) MessageStreamID {
	return StreamRegistry.GetStreamID(stream)
}
func (streamID MessageStreamID) GetName() string {
	return StreamRegistry.GetStreamName(streamID)
}
func (registry *streamRegistry) GetStreamID(stream string) MessageStreamID {
	hash := fnv.New64a()
	hash.Write([]byte(stream))
	streamID := MessageStreamID(hash.Sum64())
	registry.nameGuard.Lock()
	registry.name[streamID] = stream
	registry.nameGuard.Unlock()
	return streamID
}
func (registry streamRegistry) GetStreamName(streamID MessageStreamID) string {
	switch streamID {
	case LogInternalStreamID:
		return LogInternalStream
	case WildcardStreamID:
		return WildcardStream
	case InvalidStreamID:
		return InvalidStream
	case TraceInternalStreamID:
		return TraceInternalStream
	default:
		registry.nameGuard.RLock()
		name, exists := registry.name[streamID]
		registry.nameGuard.RUnlock()
		if exists {
			return name  
		}
	}
	return ""
}
func (registry streamRegistry) GetRouterByStreamName(name string) Router {
	streamID := registry.GetStreamID(name)
	return registry.GetRouter(streamID)
}
func (registry streamRegistry) GetRouter(id MessageStreamID) Router {
	registry.streamGuard.RLock()
	stream, exists := registry.routers[id]
	registry.streamGuard.RUnlock()
	if exists {
		return stream
	}
	return nil
}
func (registry streamRegistry) IsStreamRegistered(id MessageStreamID) bool {
	registry.streamGuard.RLock()
	_, exists := registry.routers[id]
	registry.streamGuard.RUnlock()
	return exists
}
func (registry streamRegistry) ForEachStream(callback func(streamID MessageStreamID, stream Router)) {
	registry.streamGuard.RLock()
	defer registry.streamGuard.RUnlock()
	for streamID, router := range registry.routers {
		callback(streamID, router)
	}
}
func (registry *streamRegistry) WildcardProducersExist() bool {
	return len(registry.wildcard) > 0
}