func (s *Subscription) Unsubscribe() {
	s.sr.Unsubscribe(s)
}
Proxy to registry
package nats
import (
	"fmt"
	"math/rand"
	"net"
	"sync"
	"time"
)
type Subscription struct {
	sr *subscriptionRegistry
	c *Connection
	sid      uint
	frozen   bool
	maximum  uint
	received uint
	subject string
	queue   string
	Inbox chan *readMessage
}
func (s *Subscription) freeze() {
	if s.frozen {
		panic("subscription is frozen")
	}
	s.frozen = true
}
func (s *Subscription) SetSubject(v string) {
	if s.frozen {
		panic("subscription is frozen")
	}
	s.subject = v
}
func (s *Subscription) SetQueue(v string) {
	if s.frozen {
		panic("subscription is frozen")
	}
	s.queue = v
}
func (s *Subscription) SetMaximum(v uint) {
	if s.frozen {
		panic("subscription is frozen")
	}
	s.maximum = v
}
func (s *Subscription) Subscribe() {
	s.sr.Subscribe(s)
}
func (s *Subscription) subscribe(c *Connection) {
	if s.c == c {
		return
	}
	s.c = c
	wc := make(chan writeObject, 2)
	ws := new(writeSubscribe)
	ws.Sid = s.sid
	ws.Subject = s.subject
	ws.Queue = s.queue
	wc <- ws
	if s.maximum > 0 {
		wu := new(writeUnsubscribe)
		wu.Sid = s.sid
		wu.Maximum = s.maximum - s.received
		wc <- wu
	}
	close(wc)
	c.WriteChannel(wc)
}