func (em *EventMeter) Subscribe(query string, cb EventCallbackFunc) error {
	em.mtx.Lock()
	defer em.mtx.Unlock()

	if err := em.wsc.Subscribe(context.TODO(), query); err != nil {
		return err
	}

	metric := &EventMetric{
		meter:    metrics.NewMeter(),
		callback: cb,
	}
	em.queryToMetricMap[query] = metric
	return nil
}
// Subscribe for the given query. Callback function will be called upon
// receiving an event.
Subscribe for the given query. Callback function will be called upon
receiving an event.
// Subscribe for the given query . Callback function will be called upon // receiving an event .
func (em *EventMeter) Subscribe(query string, cb EventCallbackFunc) error {
	em.mtx.Lock()
	defer em.mtx.Unlock()
	if err := em.wsc.Subscribe(context.TODO(), query); err != nil {
		return err
	}
	metric := &EventMetric{
		meter:    metrics.NewMeter(),
		callback: cb,
	}
	em.queryToMetricMap[query] = metric
	return nil
}
func ( em * EventMeter ) Subscribe ( query string , cb EventCallbackFunc ) error { em . mtx . Lock ( ) defer em . mtx . Unlock ( ) if err := em . wsc . Subscribe ( context . TODO ( ) , query ) ; err != nil { return err } metric := & EventMetric { meter : metrics . NewMeter ( ) , callback : cb , } em . queryToMetricMap [ query ] = metric return nil }
Subscribe for the given query.
Subscribe for the given query .