INNER CODE UNIT · Go

func

resgateio/resgate · nats/nats.go:240

func (s *Subscription) Unsubscribe() error {
	s.c.mu.Lock()
	defer s.c.mu.Unlock()

	s.c.Tracef("U=> %s", s.sub.Subject)

	delete(s.c.mqReqs, s.sub)
	return s.sub.Unsubscribe()
}

func (c *Client) listener(ch chan *nats.Msg, stopped chan struct{}) {
	for msg := range ch {
		c.mu.Lock()
		rc, ok := c.mqReqs[msg.Sub]
		if ok && rc.isReq {
			// Is the first character a-z or A-Z?
			// Then it is a meta response
			if len(msg.Data) > 0 && (msg.Data[0]|32) >= 'a' && (msg.Data[0]|32) <= 'z' {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…