Exemple #1
0
        public static Process Spawn(Loop loop, ProcessOptions options, Action <Process, int, int> exitCallback)
        {
            Process process = new Process(loop);

            process.Stdin  = new Pipe(loop, false);
            process.Stdout = new Pipe(loop, false);
            process.Stderr = new Pipe(loop, false);

            uv_process_options_t options_t = new uv_process_options_t(options, (exit_status, term_status) => {
                exitCallback(process, exit_status, term_status);
                // TODO: somehow dispose this
                // options_t.Dispose();
            });

            options_t.stdin_stream  = process.Stdin.handle;
            options_t.stdout_stream = process.Stdout.handle;
            options_t.stderr_stream = process.Stderr.handle;

            int r = uv_spawn(loop.Handle, process.handle, options_t);

            Ensure.Success(r, loop);

            return(process);
        }
Exemple #2
0
 internal Process(Loop loop, ProcessOptions options, Action <Process> exitCallback)
     : base(loop, HandleType.UV_PROCESS)
 {
     this.exitCallback = exitCallback;
     process_options   = new uv_process_options_t(this, options);
 }
Exemple #3
0
 internal static extern int uv_spawn(IntPtr loop, IntPtr handle, ref uv_process_options_t options);
Exemple #4
0
 internal static extern int uv_spawn(IntPtr loop, IntPtr handle, uv_process_options_t options);
Exemple #5
0
        public static Process Spawn(Loop loop, ProcessOptions options, Action<Process, int, int> exitCallback)
        {
            Process process = new Process(loop);

            process.Stdin = new Pipe(loop, false);
            process.Stdout = new Pipe(loop, false);
            process.Stderr = new Pipe(loop, false);

            uv_process_options_t options_t = new uv_process_options_t(options, (exit_status, term_status) => {
                exitCallback(process, exit_status, term_status);
                // TODO: somehow dispose this
                // options_t.Dispose();
            });

            options_t.stdin_stream = process.Stdin.handle;
            options_t.stdout_stream = process.Stdout.handle;
            options_t.stderr_stream = process.Stderr.handle;

            int r = uv_spawn(loop.Handle, process.handle, options_t);
            Ensure.Success(r, loop);

            return process;
        }
Exemple #6
0
		internal Process(Loop loop, ProcessOptions options, Action<Process> exitCallback)
			: base(loop, HandleType.UV_PROCESS)
		{
			this.exitCallback = exitCallback;
			process_options = new uv_process_options_t(this, options);
		}