func (l *locQueue) Subscribe(quit <-chan struct{}, topics ...string) (chan SubscribeMessage, chan error) {
	result := make(chan SubscribeMessage, l.size)
	l.subscriberAdd(result, topics...)
	go func() {
		<-quit
		l.subscriberDelete(result, topics...)
		close(result)
	}()
	return result, make(chan error)
}
Subscribes to topic(s)
package ergoq
import (
	"strconv"
	"sync"
	"github.com/phonkee/godsn"
)
const (
	defaultLocQueueSize = 1000
)
func init() {
	Register("loc", &locDriver{})
}
type locDriver struct{}
func (l *locDriver) Open(d string) (MessageQueuer, error) {
	DSN, err := godsn.Parse(d)
	if err != nil {
		return nil, err
	}
	result := &locQueue{
		mutex:  &sync.RWMutex{},
		size:   DSN.GetInt("size", defaultLocQueueSize),
		queues: make(map[string]chan QueueMessage),
		pubsub: make(map[string]map[chan SubscribeMessage]struct{}),
	}
	return result, nil
}
func (l *locDriver) OpenConnection(connection interface{}, settings string) (MessageQueuer, error) {
	return nil, nil
}
type locQueue struct {
	mutex *sync.RWMutex
	size int
	queues map[string]chan QueueMessage
	pubsub map[string]map[chan SubscribeMessage]struct{}
}
func (l *locQueue) Push(queue string, message []byte) error {
	l.mutex.RLock()
	q, ok := l.queues[queue]
	l.mutex.RUnlock()
	if !ok {
		l.mutex.Lock()
		if _, okExists := l.queues[queue]; !okExists {
			l.queues[queue] = make(chan QueueMessage, l.size)
		}
		q = l.queues[queue]
		l.mutex.Unlock()
	}
	q <- newLocQueueMessage(queue, message)
	return nil
}
func (l *locQueue) Pop(queue string) (QueueMessage, error) {
	l.mutex.RLock()
	q, ok := l.queues[queue]
	l.mutex.RUnlock()
	if !ok {
		return nil, nil
	}
	l.mutex.Lock()
	defer l.mutex.Unlock()
	q, ok = l.queues[queue]
	if !ok {
		return nil, nil
	}
	if len(q) == 0 {
		return nil, nil
	}
	result := <-q
	return result, nil
}
func (l *locQueue) Publish(topic string, message []byte) (err error) {
	l.mutex.RLock()
	mc, ok := l.pubsub[topic]
	if !ok {
		return
	}
	for key := range mc {
		key <- NewSubscriberMessage(topic, message)
	}
	l.mutex.RUnlock()
	return nil
}