Beispiel #1
0
        /// <summary>
        /// Creates the new sandbox based on the given request and runs it.
        /// </summary>
        /// <param name="request">The request that will contain the sandbox details.</param>
        /// <param name="compiler">The compiler being used for the process.</param>
        internal async Task HandleSingleCompileSandboxRequest(CompileSourceRequest request, Types.Compiler compiler)
        {
            var sandbox = new CompileSandbox(this._logger, this._dockerClient, request, compiler);

            this.AddSandbox(sandbox);

            sandbox.StatusChangeEvent += this.OnStatusChangeEvent;
            sandbox.CompletedEvent    += this.OnCompileSandboxCompletionEvent;

            await sandbox.Run();
        }
Beispiel #2
0
 /// <summary>
 /// Removes the sandbox from the internal queue.
 /// </summary>
 /// <param name="sandbox">The sandbox being removed.</param>
 public void RemoveSandbox(CompileSandbox sandbox) => this._executingSandboxes.Remove(sandbox);
Beispiel #3
0
 /// <summary>
 /// Used to add sandboxes to the internal queue, allowing the boxes to get the updated events.
 /// </summary>
 /// <param name="sandbox">The sandbox being updated.</param>
 public void AddSandbox(CompileSandbox sandbox) => this._executingSandboxes.Add(sandbox);