Пример #1
0
        public void OnReloaded(DisquuunSocket reloadedSocket)
        {
            lock (lockObject) {
                if (stackSocket.IsQueued())
                {
                    if (reloadedSocket.IsChoosable())
                    {
                        reloadedSocket.SetBusy();

                        var commandAndData = stackSocket.Dequeue();
                        switch (commandAndData.executeType)
                        {
                        case DisquuunExecuteType.ASYNC: {
                            reloadedSocket.Async(commandAndData.commands, commandAndData.data, commandAndData.Callback);
                            return;
                        }

                        case DisquuunExecuteType.LOOP: {
                            reloadedSocket.Loop(commandAndData.commands, commandAndData.data, commandAndData.Callback);
                            return;
                        }

                        case DisquuunExecuteType.PIPELINE: {
                            reloadedSocket.Execute(commandAndData.commands, commandAndData.data, commandAndData.Callback);
                            return;
                        }
                        }
                    }
                }
            }
        }
Пример #2
0
        public void OnReloaded(DisquuunSocket reloadedSocket)
        {
            lock (lockObject) {
                if (stackSocket.IsQueued())
                {
                    if (reloadedSocket.IsChoosable())
                    {
                        reloadedSocket.SetBusy();

                        var commandAndData = stackSocket.Dequeue();

                        if (commandAndData.data.Length == 0)
                        {
                            Disquuun.Log("OnReloaded len = 0.", true);
                        }
                        switch (commandAndData.executeType)
                        {
                        case DisquuunExecuteType.ASYNC: {
                            reloadedSocket.Async(commandAndData.command, commandAndData.data, commandAndData.Callback);
                            return;
                        }

                        case DisquuunExecuteType.LOOP: {
                            reloadedSocket.Loop(commandAndData.command, commandAndData.data, commandAndData.Callback);
                            return;
                        }
                        }
                    }
                }
            }
        }
Пример #3
0
        public void OnReloaded(DisquuunSocket reloadedSocket)
        {
            // consume stacked command if need.
            lock (poolLock)
            {
                if (disquuunDataStack.IsQueued())
                {
                    if (reloadedSocket.IsAvailable())
                    {
                        reloadedSocket.SetBusy();

                        var commandAndData = disquuunDataStack.Dequeue();
                        switch (commandAndData.executeType)
                        {
                        case DisquuunExecuteType.ASYNC:
                        {
                            reloadedSocket.Async(commandAndData.commands, commandAndData.data, commandAndData.Callback);
                            return;
                        }

                        case DisquuunExecuteType.LOOP:
                        {
                            reloadedSocket.Loop(commandAndData.commands, commandAndData.data, commandAndData.Callback);
                            return;
                        }

                        case DisquuunExecuteType.PIPELINE:
                        {
                            reloadedSocket.Execute(commandAndData.commands, commandAndData.data, commandAndData.Callback);
                            return;
                        }
                        }
                    }
                }
            }
        }