Exemplo n.º 1
0
        /// <summary>
        /// 指定对象标识,超时时长(秒为单位),超时执行回调,加入到超时检测字典中
        /// </summary>
        /// <param name="objectKey"></param>
        /// <param name="timeoutSeconds"></param>
        /// <param name="callback"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public long AddTimeoutTask(T objectKey, int timeoutSeconds, TimeoutCallback <T> callback, String context)
        {
            TimeoutTask <T> task = new TimeoutTask <T>();

            task.ObjectKey      = objectKey;
            task.TimeoutSeconds = timeoutSeconds;
            task.Callback       = callback;
            long taskId = GetNextTaskId();

            task.TaskId             = taskId;
            task.ExecuteSecondTicks = DateTime.Now.Ticks / 10000000 + timeoutSeconds;
            task.Context            = context;

            lock (_DictionaryLocker)
            {
                // 以任务标识为主键的任务清单
                _TaskIdDictionary[taskId] = task;
                // 以对象标识为主键的任务清单
                if (_TaskObjectKeyDictionary.ContainsKey(objectKey))
                {
                    _TaskObjectKeyDictionary[objectKey].Add(task);
                }
                else
                {
                    List <TimeoutTask <T> > list = new List <TimeoutTask <T> >();
                    list.Add(task);
                    _TaskObjectKeyDictionary[objectKey] = list;
                }
            }
            return(taskId);
        }
Exemplo n.º 2
0
        protected void Timeout(SSContext context, long timeout, TimeoutCallback callback)
        {
            long timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();

            if (timeout <= 0)
            {
                callback(context, timestamp);
            }
            else
            {
                if (m_totalServiceSession >= Int32.MaxValue)
                {
                    m_totalServiceSession = 0;
                }

                SSTimerNode timerNode = new SSTimerNode();
                timerNode.Opaque           = m_serviceAddress;
                timerNode.Session          = ++m_totalServiceSession;
                timerNode.TimeoutTimestamp = timestamp + timeout;

                SSTimer.GetInstance().Add(timerNode);

                TimeoutContext timeoutContext = new TimeoutContext();
                timeoutContext.Callback = callback;
                timeoutContext.Context  = context;
                m_timeoutCallbacks.Add(timerNode.Session, timeoutContext);
            }
        }
Exemplo n.º 3
0
 public Timeout(TimeSpan begin, TimeSpan span, IRepeatBehavior repeat, object data, TimeoutCallback callback)
 {
     this.begin = begin;
     this.span = span;
     this.repeat = repeat;
     this.data = data;
     this.callback = callback;
 }
Exemplo n.º 4
0
    public bool RemoveTimeoutListener(TimeoutCallback callback, object userData)
    {
        TimeoutListener item = new TimeoutListener();

        item.SetCallback(callback);
        item.SetUserData(userData);
        return(this.m_timeoutListeners.Remove(item));
    }
Exemplo n.º 5
0
 public Timeout(DateTime expires, TimeSpan span, IRepeatBehavior repeat, object data, TimeoutCallback callback)
 {
     this.expires = expires;
     this.span = span;
     this.repeat = repeat;
     this.data = data;
     this.callback = callback;
 }
Exemplo n.º 6
0
    // Outro
    private void PlayCinematicOutro()
    {
        _cinematicControllerOutro.PlayCinematic();
        float           duration           = (float)_cinematicControllerOutro.duration;
        TimeoutCallback onCompleteCallback = OutroCompletedHandler;

        StartCoroutine(SetTimeout(duration, OutroCompletedHandler));
    }
Exemplo n.º 7
0
 public Timeout(TimeSpan begin, TimeSpan span, IRepeatBehavior repeat, object data, TimeoutCallback callback)
 {
     this.begin    = begin;
     this.span     = span;
     this.repeat   = repeat;
     this.data     = data;
     this.callback = callback;
 }
Exemplo n.º 8
0
        // If forward progress on the script isn't made within this
        // amount of time (milliseconds), bail
        public static void Timeout(long duration, TimeoutCallback callback)
        {
            // Don't change an existing timeout
            if (_executionState != ExecutionState.RUNNING)
            {
                return;
            }

            _pauseTimeout    = DateTime.UtcNow.Ticks + (duration * 10000);
            _executionState  = ExecutionState.TIMING_OUT;
            _timeoutCallback = callback;
        }
Exemplo n.º 9
0
        public static bool ExecuteScript()
        {
            if (_activeScript == null)
            {
                return(false);
            }

            if (_executionState == ExecutionState.PAUSED)
            {
                if (_pauseTimeout < DateTime.UtcNow.Ticks)
                {
                    _executionState = ExecutionState.RUNNING;
                }
                else
                {
                    return(true);
                }
            }
            else if (_executionState == ExecutionState.TIMING_OUT)
            {
                if (_pauseTimeout < DateTime.UtcNow.Ticks)
                {
                    if (_timeoutCallback != null)
                    {
                        if (_timeoutCallback())
                        {
                            _activeScript.Advance();
                            ClearTimeout();
                        }

                        _timeoutCallback = null;
                    }

                    /* If the callback changed the state to running, continue
                     * on. Otherwise, exit.
                     */
                    if (_executionState != ExecutionState.RUNNING)
                    {
                        _activeScript = null;
                        return(false);
                    }
                }
            }

            if (!_activeScript.ExecuteNext())
            {
                _activeScript = null;
                return(false);
            }

            return(true);
        }
Exemplo n.º 10
0
    public bool AddTimeoutListener(TimeoutCallback callback, object userData)
    {
        TimeoutListener item = new TimeoutListener();

        item.SetCallback(callback);
        item.SetUserData(userData);
        if (this.m_timeoutListeners.Contains(item))
        {
            return(false);
        }
        this.m_timeoutListeners.Add(item);
        return(true);
    }
Exemplo n.º 11
0
        public static void ConnectSSLAsync(string host, int port, Factory factory, object contextFactory, int timeout, string bindAddress, ConnectedCallback callback, TimeoutCallback timeoutCallback, object state)
        {
            TcpClient client = new TcpClient();
            IAsyncResult ar = client.BeginConnect(host, port, null, new AsyncConnectState {
                responseCallback = callback,
                timeoutCallback = timeoutCallback,
                client = client,
                factory = factory,
                state = state
            });

            ThreadPool.RegisterWaitForSingleObject(ar.AsyncWaitHandle, _ConnectSSL_Callback, ar, timeout, true);
        }
Exemplo n.º 12
0
    // Intro
    private void PlayCinematicIntro()
    {
        if (_isDebug)
        {
            return;
        }

        _cinematicControllerIntro.PlayCinematic();
        float           duration           = (float)_cinematicControllerIntro.duration;
        TimeoutCallback onCompleteCallback = IntroCompletedHandler;

        StartCoroutine(SetTimeout(duration, IntroCompletedHandler));
    }
Exemplo n.º 13
0
 private void CheckVolume()
 {
     if (_isDebug)
     {
         TimeoutCallback onStopPlayingCallback = onStopPlayingHandler;
         StartCoroutine(Debounced(endGameSilenceDuration, onStopPlayingCallback));
     }
     // Trigger GameOver when user stopped playing music
     else if (data.micVolumeNormalized > 0.1f)
     {
         TimeoutCallback onStopPlayingCallback = onStopPlayingHandler;
         StartCoroutine(Debounced(endGameSilenceDuration, onStopPlayingCallback));
     }
 }
Exemplo n.º 14
0
    IEnumerator Debounced(float time, TimeoutCallback Method)
    {
        // generate a new id and set it as the latest one
        Guid guid = Guid.NewGuid();

        _latest = guid;

        // set the denounce duration here
        yield return(new WaitForSeconds(time));

        // check if this call is still the latest one
        if (_latest == guid)
        {
            Method();
        }
    }
        /// <param name="id">Id of the state.</param>
        /// <param name="displayName">Displayname of the state.</param>
        /// <param name="timeoutSec">Seconds, after the asynchronous task should be aborted.</param>
        /// <param name="timeoutCallback">Callback to report, that the task was aborted because of a timeout.</param>
        /// <param name="progressCallback">Callback to report, that the task makes progress.</param>
        public WuStateAsyncJob(WuStateId id, string displayName, int timeoutSec, TimeoutCallback timeoutCallback, ProgressChangedCallback progressCallback) : base(id, displayName)
        {
            if (timeoutSec < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(timeoutSec), "Negative timeout is not allowed.");
            }
            if (timeoutSec > int.MaxValue / 1000)
            {
                throw new ArgumentOutOfRangeException(nameof(timeoutSec), $"Max timeout is {int.MaxValue / 1000} sec.");
            }
            if (timeoutCallback == null)
            {
                throw new ArgumentNullException(nameof(timeoutCallback));
            }

            TimeoutSec = timeoutSec;
            TimeoutCallbackDelegate         = timeoutCallback;
            ProgressChangedCallbackDelegate = progressCallback;
        }
        public WuStateInstalling(IUpdateInstaller uInstaller, IUpdateCollection updates,
                                 InstallCompletedCallback completedCallback, TimeoutCallback timeoutCallback, ProgressChangedCallback progressCallback,
                                 int timeoutSec) : base(WuStateId.Installing, "Installing Updates", timeoutSec, timeoutCallback, progressCallback)
        {
            if (uInstaller == null)
            {
                throw new ArgumentNullException(nameof(uInstaller));
            }
            if (updates == null)
            {
                throw new ArgumentNullException(nameof(updates));
            }
            if (completedCallback == null)
            {
                throw new ArgumentNullException(nameof(completedCallback));
            }

            _uInstaller        = uInstaller;
            _updates           = updates;
            _completedCallback = completedCallback;
        }
Exemplo n.º 17
0
 public static Timeout AddTimeout(TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
 {
     return AppHost.AddTimeout (timespan, repeat, data, callback);
 }
Exemplo n.º 18
0
 public static Timeout AddTimeout(TimeSpan timespan, IRepeatBehavior repeat, TimeoutCallback callback)
 {
     return(AddTimeout(timespan, repeat, null, callback));
 }
Exemplo n.º 19
0
        internal ConnectionI(Communicator communicator, IceInternal.Instance instance,
                             IceInternal.ACMMonitor monitor, IceInternal.Transceiver transceiver,
                             IceInternal.Connector connector, IceInternal.EndpointI endpoint, ObjectAdapterI adapter)
        {
            _communicator = communicator;
            _instance = instance;
            _monitor = monitor;
            _transceiver = transceiver;
            _desc = transceiver.ToString();
            _type = transceiver.protocol();
            _connector = connector;
            _endpoint = endpoint;
            _adapter = adapter;
            InitializationData initData = instance.initializationData();
            _logger = initData.logger; // Cached for better performance.
            _traceLevels = instance.traceLevels(); // Cached for better performance.
            _timer = instance.timer();
            _writeTimeout = new TimeoutCallback(this);
            _writeTimeoutScheduled = false;
            _readTimeout = new TimeoutCallback(this);
            _readTimeoutScheduled = false;
            _warn = initData.properties.getPropertyAsInt("Ice.Warn.Connections") > 0;
            _warnUdp = initData.properties.getPropertyAsInt("Ice.Warn.Datagrams") > 0;
            _cacheBuffers = instance.cacheMessageBuffers() > 0;
            if(_monitor != null && _monitor.getACM().timeout > 0)
            {
                _acmLastActivity = IceInternal.Time.currentMonotonicTimeMillis();
            }
            else
            {
                _acmLastActivity = -1;
            }
            _nextRequestId = 1;
            _messageSizeMax = adapter != null ? adapter.messageSizeMax() : instance.messageSizeMax();
            _batchRequestQueue = new IceInternal.BatchRequestQueue(instance, _endpoint.datagram());
            _readStream = new IceInternal.BasicStream(instance, Util.currentProtocolEncoding);
            _readHeader = false;
            _readStreamPos = -1;
            _writeStream = new IceInternal.BasicStream(instance, Util.currentProtocolEncoding);
            _writeStreamPos = -1;
            _dispatchCount = 0;
            _state = StateNotInitialized;

            _compressionLevel = initData.properties.getPropertyAsIntWithDefault("Ice.Compression.Level", 1);
            if(_compressionLevel < 1)
            {
                _compressionLevel = 1;
            }
            else if(_compressionLevel > 9)
            {
                _compressionLevel = 9;
            }

            if(adapter != null)
            {
                _servantManager = adapter.getServantManager();
            }

            try
            {
                if(adapter != null)
                {
                    _threadPool = adapter.getThreadPool();
                }
                else
                {
                    _threadPool = instance.clientThreadPool();
                }
                _threadPool.initialize(this);
            }
            catch(LocalException)
            {
                throw;
            }
            catch(System.Exception ex)
            {
                throw new SyscallException(ex);
            }
        }
Exemplo n.º 20
0
 public static Timeout AddTimeout(TimeSpan timespan, IRepeatBehavior repeat, TimeoutCallback callback)
 {
     return AddTimeout (timespan, repeat, null, callback);
 }
Exemplo n.º 21
0
 public static void AddTimeout(TimeSpan timespan, TimeoutCallback callback)
 {
     AddTimeout(timespan, RepeatBehavior.Single, null, callback);
 }
Exemplo n.º 22
0
 public static void AddTimeout(TimeSpan timespan, object data, TimeoutCallback callback)
 {
     AddTimeout(timespan, RepeatBehavior.Single, data, callback);
 }
Exemplo n.º 23
0
        internal ConnectionI(Communicator communicator, IceInternal.Instance instance,
                             IceInternal.ConnectionReaper reaper, IceInternal.Transceiver transceiver,
                             IceInternal.Connector connector, IceInternal.EndpointI endpoint, ObjectAdapter adapter)
        {
            _communicator = communicator;
            _instance = instance;
            _reaper = reaper;
            InitializationData initData = instance.initializationData();
            _transceiver = transceiver;
            _desc = transceiver.ToString();
            _type = transceiver.type();
            _connector = connector;
            _endpoint = endpoint;
            _adapter = adapter;
            _dispatcher = initData.dispatcher; // Cached for better performance.
            _logger = initData.logger; // Cached for better performance.
            _traceLevels = instance.traceLevels(); // Cached for better performance.
            _timer = instance.timer();
            _writeTimeout = new TimeoutCallback(this);
            _writeTimeoutScheduled = false;
            _writeStreamPos = -1;
            _readTimeout = new TimeoutCallback(this);
            _readTimeoutScheduled = false;
            _readStreamPos = -1;
            _warn = initData.properties.getPropertyAsInt("Ice.Warn.Connections") > 0;
            _warnUdp = initData.properties.getPropertyAsInt("Ice.Warn.Datagrams") > 0;
            _cacheBuffers = initData.properties.getPropertyAsIntWithDefault("Ice.CacheMessageBuffers", 1) == 1;
            _acmAbsoluteTimeoutMillis = 0;
            _nextRequestId = 1;
            _batchAutoFlush = initData.properties.getPropertyAsIntWithDefault("Ice.BatchAutoFlush", 1) > 0;
            _batchStream = new IceInternal.BasicStream(instance, Util.currentProtocolEncoding, _batchAutoFlush);
            _batchStreamInUse = false;
            _batchRequestNum = 0;
            _batchRequestCompress = false;
            _batchMarker = 0;
            _readStream = new IceInternal.BasicStream(instance, Util.currentProtocolEncoding);
            _readHeader = false;
            _writeStream = new IceInternal.BasicStream(instance, Util.currentProtocolEncoding);
            _dispatchCount = 0;
            _state = StateNotInitialized;

            _compressionLevel = initData.properties.getPropertyAsIntWithDefault("Ice.Compression.Level", 1);
            if(_compressionLevel < 1)
            {
                _compressionLevel = 1;
            }
            else if(_compressionLevel > 9)
            {
                _compressionLevel = 9;
            }

            ObjectAdapterI adapterImpl = _adapter as ObjectAdapterI;
            if(adapterImpl != null)
            {
                _servantManager = adapterImpl.getServantManager();
            }

            try
            {
                if(_endpoint.datagram())
                {
                    _acmTimeout = 0;
                }
                else
                {
                    if(adapterImpl != null)
                    {
                        _acmTimeout = adapterImpl.getACM();
                    }
                    else
                    {
                        _acmTimeout = _instance.clientACM();
                    }
                }

                if(adapterImpl != null)
                {
                    _threadPool = adapterImpl.getThreadPool();
                }
                else
                {
                    _threadPool = instance.clientThreadPool();
                }
                _threadPool.initialize(this);
            }
            catch(LocalException)
            {
                throw;
            }
            catch(System.Exception ex)
            {
                throw new SyscallException(ex);
            }
        }
Exemplo n.º 24
0
    public void download(string fullURL, string fileName, long offset, DownloadingCallback downloading, TimeoutCallback timeout, StartCallback start, FinishCallback finish)
    {
        mDownloadListLock.waitForUnlock();
        DownloadInfo info = new DownloadInfo();

        // 下载地址里需要将空格替换为%20
        info.mURL                 = StringUtility.strReplaceAll(fullURL, " ", "%20");
        info.mFileName            = fileName;
        info.mDownloadingCallback = downloading;
        info.mStartCallback       = start;
        info.mFinishCallback      = finish;
        info.mTimeoutCallback     = timeout;
        info.mDownloadOffset      = offset;
        mDownloadList.Add(info);
        mDownloadListLock.unlock();
    }
Exemplo n.º 25
0
 public bool RemoveTimeoutListener(TimeoutCallback callback)
 {
     return(this.RemoveTimeoutListener(callback, null));
 }
Exemplo n.º 26
0
        public static Timeout AddTimeout(TimeSpan begin, TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
        {
            Timeout t = new Timeout(begin, timespan, repeat, data, callback);

            ITimerWatcher timer;

            timer = context.CreateTimerWatcher(begin, timespan, delegate {
                t.Run(app);
                if (!t.ShouldContinueToRepeat())
                {
                    t.Stop();
                    timer.Dispose();
                }
            });

            timer.Start();

            return(t);
        }
Exemplo n.º 27
0
 public static void ConnectSSLAsync(string host, int port, Factory factory, object contextFactory, int timeout, ConnectedCallback callback, TimeoutCallback timeoutCallback, object state)
 {
     ConnectSSLAsync(host, port, factory, contextFactory, timeout, null, callback, timeoutCallback, state);
 }
Exemplo n.º 28
0
 public bool AddTimeoutListener(TimeoutCallback callback)
 {
     return(this.AddTimeoutListener(callback, null));
 }
Exemplo n.º 29
0
        public static void ConnectSSLAsync(string host, int port, Factory factory, object contextFactory, int timeout, string bindAddress, ConnectedCallback callback, TimeoutCallback timeoutCallback, object state)
        {
            TcpClient    client = new TcpClient();
            IAsyncResult ar     = client.BeginConnect(host, port, null, new AsyncConnectState {
                responseCallback = callback,
                timeoutCallback  = timeoutCallback,
                client           = client,
                factory          = factory,
                state            = state
            });

            ThreadPool.RegisterWaitForSingleObject(ar.AsyncWaitHandle, _ConnectSSL_Callback, ar, timeout, true);
        }
Exemplo n.º 30
0
        public static void AddTimeout(TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
        {
            Timeout t = new Timeout (DateTime.UtcNow + timespan, timespan, repeat, data, callback);

            ioloop.AddTimeout (t);
        }
Exemplo n.º 31
0
 public static Timeout AddTimeout(TimeSpan timespan, object data, TimeoutCallback callback)
 {
     return(AddTimeout(timespan, RepeatBehavior.Single, data, callback));
 }
Exemplo n.º 32
0
 public Timeout(TimeSpan span, IRepeatBehavior repeat, object data, TimeoutCallback callback)
     : this(TimeSpan.Zero, span, repeat,data, callback)
 {
 }
Exemplo n.º 33
0
        public static Timeout AddTimeout(TimeSpan begin, TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
        {
            Timeout t = new Timeout(begin, timespan, repeat, data, callback);

            ioloop.AddTimeout(t);

            return(t);
        }
Exemplo n.º 34
0
 public static void AddTimeout(TimeSpan timespan, IRepeatBehavior repeat, TimeoutCallback callback)
 {
     AddTimeout (timespan, repeat, null, callback);
 }
Exemplo n.º 35
0
        public static Timeout AddTimeout(TimeSpan begin, TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
        {
            Timeout t = new Timeout (begin, timespan, repeat, data, callback);

            ITimerWatcher timer = null;
            timer = context.CreateTimerWatcher (begin, timespan, delegate {
                t.Run (app);
                if (!t.ShouldContinueToRepeat ()) {
                    t.Stop ();
                    timer.Dispose ();
                }
            });

            timer.Start ();

            return t;
        }
Exemplo n.º 36
0
 public static void AddTimeout(TimeSpan timespan, IRepeatBehavior repeat, TimeoutCallback callback)
 {
     AddTimeout(timespan, repeat, null, callback);
 }
Exemplo n.º 37
0
    // Utils
    IEnumerator SetTimeout(float time, TimeoutCallback Method)
    {
        yield return(new WaitForSecondsRealtime(time));

        Method();
    }
Exemplo n.º 38
0
 public static void AddTimeout(TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
 {
     AppHost.AddTimeout(timespan, repeat, data, callback);
 }
Exemplo n.º 39
0
 public WuStateAsyncJobProxy(WuStateId id, string displayName, int timeoutSec, TimeoutCallback timeoutCallback, ProgressChangedCallback progressCallback)
     : base(id, displayName, timeoutSec, timeoutCallback, progressCallback)
 {
 }
Exemplo n.º 40
0
 public static Timeout AddTimeout(TimeSpan timespan, TimeoutCallback callback)
 {
     return AddTimeout (timespan, RepeatBehavior.Single, null, callback);
 }
Exemplo n.º 41
0
        public static Timeout AddTimeout(TimeSpan begin, TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
        {
            Timeout t = new Timeout (begin, timespan, repeat, data, callback);

            ioloop.AddTimeout (t);

            return t;
        }
Exemplo n.º 42
0
 public static Timeout AddTimeout(TimeSpan timespan, object data, TimeoutCallback callback)
 {
     return AddTimeout (timespan, RepeatBehavior.Single, data, callback);
 }
Exemplo n.º 43
0
 internal static extern void iAsyncWait(TimeoutCallback callback, Sirikata.Runtime.TimeClass t);
Exemplo n.º 44
0
 public Timeout(TimeSpan span, IRepeatBehavior repeat, object data, TimeoutCallback callback) : this(TimeSpan.Zero, span, repeat, data, callback)
 {
 }
Exemplo n.º 45
0
 public static bool AsyncWait(TimeoutCallback callback, Sirikata.Runtime.Time t)
 {
     if (callback==null) return false;
     iAsyncWait(callback,t.toClass());
     return true;
 }
Exemplo n.º 46
0
 public static void ConnectSSLAsync(string host, int port, Factory factory, object contextFactory, int timeout, ConnectedCallback callback, TimeoutCallback timeoutCallback, object state)
 {
     ConnectSSLAsync(host, port, factory, contextFactory, timeout, null, callback, timeoutCallback, state);
 }
Exemplo n.º 47
0
 public static void SetupTickFunction(TimeoutCallback tc, Sirikata.Runtime.Time t)
 {
     long us=t.microseconds();
     TimeoutCallback wrapped_tc=null;
     long estLocalTime=GetLocalTime().microseconds()+us*2;
     wrapped_tc=new TimeoutCallback(delegate(){
         try {
             tc();
         }finally {
             long delta=estLocalTime-GetLocalTime().microseconds();
             estLocalTime+=us;
             if (delta>0) {
                 iAsyncWait(wrapped_tc,new TimeClass((ulong)delta));
             }else {
                 iAsyncWait(wrapped_tc,new TimeClass());
             }
         }
     });
     iAsyncWait(wrapped_tc,t.toClass());
 }
Exemplo n.º 48
0
 public static Timeout AddTimeout(TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
 {
     return(AddTimeout(timespan, timespan, repeat, data, callback));
 }
Exemplo n.º 49
0
 public static void AddTimeout(TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
 {
     AddTimeout (timespan, timespan, repeat, data, callback);
 }