| 719 | } |
| 720 | |
| 721 | func newClientSubscription(c *Client, namespace string, channel reflect.Value) *ClientSubscription { |
| 722 | sub := &ClientSubscription{ |
| 723 | client: c, |
| 724 | namespace: namespace, |
| 725 | etype: channel.Type().Elem(), |
| 726 | channel: channel, |
| 727 | quit: make(chan struct{}), |
| 728 | err: make(chan error, 1), |
| 729 | in: make(chan json.RawMessage), |
| 730 | } |
| 731 | return sub |
| 732 | } |
| 733 | |
| 734 | // Err returns the subscription error channel. The intended use of Err is to schedule |
| 735 | // resubscription when the client connection is closed unexpectedly. |