示例#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();
        }
示例#2
0
 /// <summary>
 /// Publishes a request to compile and execute the code.
 /// A standard compile process.
 /// </summary>
 /// <param name="request">The request that would be compiled.</param>
 public async Task PublishCompileSourceRequest(CompileSourceRequest request)
 {
     await this._producer.PublishAsync("compiling", JsonConvert.SerializeObject(request));
 }