public async Task <CompassResult> SendRequestAsync(CompassEvent compassEvent)
        {
            // if no compass url is set, then we bail
            if (_options.CompassUri == null)
            {
                throw new NoCompassEndpointSetException(compassEvent.EventName);
            }

            // build the request and send
            return(await CompassRestClient.SendRequestAsync <CompassResult>(_options.CompassUri, compassEvent));
        }
        public async Task <ServiceSubscription> ClientSubscribe(ServiceSubscription serviceSubscription)
        {
            // if no compass url is set, then we exit.
            if (_options.CompassUri == null)
            {
                throw new NoCompassEndpointSetException();
            }

            var response =
                await CompassRestClient.SendRequestAsync <ServiceSubscription>(
                    new Uri(_options.CompassUri, "subscribe"), serviceSubscription);

            // default timer of 15 seconds
            var heartbeat = new CompassHeartbeat(_options);

            heartbeat.SendBeatAsync(response);

            return(response);
        }