code: func (c *Client) workOnTask(t task) {
  	switch t.Action {
  	case subscribeAction:
  		event := t.Listener.Event
  		// Check to see if it already exists in the subscribed map.
  		// If not, then we need to create a new listener list and
  		// start listening on the pubsub client. Otherwise just
  		// append it.
  		if _, exists := c.subscribed[event]; !exists || t.Force {
  			c.subscribed[event] = []*Listener{t.Listener}
  			switch t.Listener.Type {
  			case Channel:
  				c.pubsub.Subscribe(event)
  			case Pattern:
  				c.pubsub.PSubscribe(event)
  			}
  		} else {
  			c.subscribed[event] = append(c.subscribed[event], t.Listener)
  		}
  	case unsubscribeAction:
  		event := t.Listener.Event
  		// Look for the listener in the subscribed list and,
  		// once found, remove it.
  		list := c.subscribed[event]
  		for i, l := range list {
  			if l == t.Listener {
  				c.subscribed[event] = append(list[:i], list[i+1:]...)
  				break
  			}
  		}
  
  		// If the list is now empty, we can unsubscribe on Redis and
  		// remove it from our registery
  		if len(c.subscribed[event]) == 0 || t.Force {
  			switch t.Listener.Type {
  			case Channel:
  				c.pubsub.Unsubscribe(event)
  			case Pattern:
  				c.pubsub.PUnsubscribe(event)
  			}
  			delete(c.subscribed, event)
  		}
  	case disruptAction:
  		c.pubsub.Conn.Close()
  	default:
  		panic("unknown task")
  	}
  }
docs: // Takes a task, modifies redis and the internal subscribed registery.
  // This is done here (called in boot()) since Go's maps are not thread safe.