using System;
public class Program
{
private Process _process;
private void StartProcess (){
(new Thread(() => {
// initialize process etc...
_process.OutputDataReceived += new DataReceivedEventHandler((o,d)=> {
// Parse and handle data...
});
// etc...
})).Start();
}
public async Task<int> GetInt () {
// Causes the process to generate an output to stdout
// which is parsed by the DataReceivedEventHandler.
// How would I' make this async?
_process.StandardInput.WriteLine("get int");