示例#1
0
        public AsyncWorker(AsyncDispatcher dispatcher)
        {
            Errno err = (dispatcher != null ? Errno.OK : Errno.InvalidArg);

            if (err == Errno.OK)
            {
                _dispatcher = dispatcher;
                this.status = Status.Ready;
            }

            Debug.Assert(err == Errno.OK);
        }
    // Use this for initialization
    void Start()
    {
        //Log.debug("ENTER AsyncDispatchBehaviour.Start");

        _dispatcher = new AsyncDispatcher((sbyte)MaxConcurrent);
        _dispatcher.idleTimeout = IdleTimeout;
        _dispatcher.killIdleNumOnce = KillIdleNumOnce;
        _dispatcher.leastWorkerNum = (sbyte)LeastWorkerNum;
        _dispatcher.postNumOnce = PostNumOnce;
        _dispatcher.ensureLaunchedWorkers((sbyte)InitialLaunched);

        _lastTimestamp = DateTime.UtcNow;

        //test();

        //Log.debug("LEAVE AsyncDispatchBehaviour.Start");
    }
示例#3
0
 // Use this for initialization
 void Start()
 {
     uidCounter = 123456;
     _dispatcherMono = transform.GetComponent<AsyncDispatchBehaviour>();
     _dispatcher = _dispatcherMono.getDispatcher();
     Invoke("initMap", 0.01f);
 }