Interval between WorkflowIdled and persistence

In experimenting with how the runtime persists an Idle workflow, it appears to do so within a couple seconds after the WorkflowIdled event.  In our case, we have many calls out to services that will can take significantly longer than this, in the 2 - 30 seconds range.  I'd like to avoid the performance hit of Persistence in this case, and trigger a persistence only after 30 seconds.  Is there a way to configure this interval between WorkflowIdled and peristence

Thanks,
Riley


Answer this question

Interval between WorkflowIdled and persistence

  • fly-007

    Riley,

    One way to do this would be to ensure UnloadOnIdle is set to "false", and then subscribe to the workflow's OnIdle event.  In your event handler, you could use a timer to call a method after 30 seconds that would unload the instance.

    Arjun

  • Danny Fürniß

    Thanks Arjun.  That would work, and as well will allow us to be as selective as necessary when deciding which workflow to persist and when.
    Riley

  • Interval between WorkflowIdled and persistence