public IAsyncResult BegingetAvailableBikes(string city, string station, int delay, AsyncCallback callback, object state)
        {
            var asyncResult = new SimpleAsyncResult <int>(state);

            // mimic a long running operation
            var timer = new System.Timers.Timer(DelayMilliseconds);

            timer.Elapsed += (_, args) =>
            {
                asyncResult.Result      = getAvailableBikes(city, station, delay);
                asyncResult.IsCompleted = true;
                callback(asyncResult);
                timer.Enabled = false;
                timer.Close();
            };
            timer.Enabled = true;
            return(asyncResult);
        }
        public IAsyncResult BegingetCities(AsyncCallback callback, object state)
        {
            var asyncResult = new SimpleAsyncResult <IList <string> >(state);

            // mimic a long running operation
            var timer = new System.Timers.Timer(DelayMilliseconds);

            timer.Elapsed += (_, args) =>
            {
                asyncResult.Result      = getCities();
                asyncResult.IsCompleted = true;
                callback(asyncResult);
                timer.Enabled = false;
                timer.Close();
            };
            timer.Enabled = true;
            return(asyncResult);
        }