I have a simple ETL setup to read some data and write to a file in
JSON.  It works until I added an abstractoperation to interrupt on
keypress.  Now, when I press a key then execution does stop, but
execution seems to stall rather than stop.  Does anyone recognize why
this may not work?  The code is below, when I add BreakOnConsoleIn,
then the call to Execute.Process() does not return.  What I expect is
for execution to finish without processing any data after the
keypress.

Here is the abstract operation which causes a stall:

    public class BreakOnConsoleIn : AbstractOperation
    {
        public override IEnumerable<Row> Execute(IEnumerable<Row>
rows)
        {
            foreach(var row in rows)
            {
                if (Console.KeyAvailable)
                {
                    yield break;
                }

                yield return row;
            }
        }
    }

Here is the code where I run the operations:

            EtlProcess etlProcess = new EmptyProcess();
            etlProcess.PipelineExecuter = new
SingleThreadedPipelineExecuter();

            etlProcess.Register(new
ConventionInputCommandOperation(config)
                {
                    Command = "SELECT * FROM " + TableName + " ORDER
BY " + IdColumn
                });
            etlProcess.RegisterLast(new BreakOnConsoleIn());
            etlProcess.RegisterLast(new
WriteAsJsonArray(GetSelectedOutputWriter()));

            etlProcess.Execute();

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en.

Reply via email to