/// <summary> /// Обрабатывает получение сообщения /// </summary> /// <param name="sender"></param> /// <param name="routingKey"></param> /// <param name="message"></param> /// <returns></returns> private ValueTask <(MessageActionType action, bool requeuee)> HandleTask(IInputQueue sender, string routingKey, string message) { this._startEvent.WaitOne(); var request = JsonConvert.DeserializeObject <Request>(message); var srcPath = this.SaveSourceData(request.Answer); var context = new ApplicationRunContext() { MemoryLimit = request.MemoryLimit < 1 ? this._applicationConfig.MaximumMemoryUsage : request.MemoryLimit, ExecutionTimeLimit = request.TimeLimit < TimeSpan.FromSeconds(0) ? this._applicationConfig.MaximumExecutionTime : request.TimeLimit, IsInterpreter = this._applicationConfig.IsInterpreter }; Response response; if (this._applicationConfig.IsInterpreter) { var appName = Path.GetFileName(srcPath); Directory.CreateDirectory(_applicationConfig.RunDir); File.Copy(srcPath, Path.Combine(_applicationConfig.RunDir, appName)); context.AppName = appName; response = this.RunAllTests(request.Input, context); } else { if (this.Build(srcPath, out var appName, out var errorLog)) { context.AppName = appName; File.Move(appName, Path.Combine(_applicationConfig.RunDir, appName)); response = this.RunAllTests(request.Input, context); }
public Application(IInputQueue inputQueue, IOutputQueue outputQueue, IApplicationConfig applicationConfig) { inputQueue.Received = this.HandleTask; this._outputQueue = outputQueue; this._applicationConfig = applicationConfig; this._startEvent = new ManualResetEvent(false); }
public GameField(Size size, IInputQueue queue) { _size = size; _queue = queue; _sprite = new ModifyableSprite(size); _currentFigure = new FigureI(3, 0); _peak = _size.Height; }
public ProducerUnit( IInputQueue<string> inputQueue, IOutputQueue<string> outputQueue, IExtractor<string, string> extractor) { InputQueue = inputQueue; OutputQueue = outputQueue; Extractor = extractor; }
public InputManager( INPUT_DEVICE_TYPE inputType, IInputDeviceFactory inputFactory, ITimeManagerFactory timeFactory, IInputAlgorithms inputAlgorithms) { this.inputDevice = inputFactory.Get(inputType: inputType); this.inputType = inputType; this.timeFactory = timeFactory; this.inputAlgorithms = inputAlgorithms; this.downPressLock = new object(); this.inputQueue = new InputQueue(); this.backgroundInputActions = new List <IInputAction>(); this.downPressLocation = new PointI[10]; this._activePointerStates = new Dictionary <uint, PointerData>(); }
protected Mouse() { this.nativeMethods = new NativeMethods(); this.inputQueue = new InputQueue(); this.inputDevice = new InputDeviceFactory().Get(type: INPUT_DEVICE_TYPE.MOUSE); }
private static async ValueTask <(MessageActionType action, bool requeuee)> HandleTask(IInputQueue sender, string routingKey, string message) { //Console.WriteLine(message); return(MessageActionType.Ack, false); }
protected Keyboard() { nativeMethods = new NativeMethods(); this.inputQueue = new InputQueue(); this.inputDevice = new InputDeviceFactory().Get(type: INPUT_DEVICE_TYPE.KEYBOARD); }
public void BindInputSerializer(IInputQueue queue) { }
public GameField(int width, int height, IInputQueue queue) : this(new Size(width, height), queue) { }
public InputQueueWithEvents(IInputQueue <T> inner, Guid id, QueueEventSource eventSource) { this.inner = inner; this.id = id; this.eventSource = eventSource; }