locked
ExecuteToComplete and excpetion RRS feed

  • Question

  • Hi,

    I use the CCR as async library for my UI. When I have a long running operation (which eventually will do I/O) I have method with this signature:

    private IEnumerator<ITask> Operation(P1 p1, P2 p2)

     

    When the user click a button (or any other trigger) I use this code to initiate the operation:

    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.5px Consolas} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.5px Consolas; min-height: 11.0px} span.s1 {color: #1b39f5} span.s2 {color: #10a3ba}

     

    var donePort = new ccr.Port<ccr.EmptyValue>();

    Arbiter.ExecuteToCompletion(new IterativeTask(iteratorHandler), donePort);

     

            TaskQueue.Enqueue(ccr.PortExtensions.Receive(donePort, x =>

                {

                  [handle run complete code]

                }

              )

            );

     

    The problem is that if the operation method throw an exception donePort is never post a EmptyValue.

    I handle it today using Causality and handle post to the ExceptionPort on that Causality but I still like to know if it is by design that the donePort never get posted?

     

    Thank you,

    Ido

    Monday, November 29, 2010 10:26 AM

Answers

  • Hi Ido, the donePort should be posted whether the handler completes cleanly or not. Is it possible you could post more detail on what the faulting code actually does?

    Thanks.

    Friday, February 18, 2011 5:14 AM
    Moderator