Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • skiltz 501 posts 701 karma points
    Jan 11, 2010 @ 02:11
    skiltz
    0

    IActionHandler run Asynchronously

    Does anyone have any comments on running an Action Handler asynchronously?  I have a long running task which I'd like to run in the "background". At the moment the process it quite time consuming and doesn't provide a very good user experience.  I guess I could move the process to a scheduled task.  Anyone ever done this?

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jan 11, 2010 @ 03:41
    Aaron Powell
    0

    Action handlers aren't designed to be run in asyn, you'd be best having your action handler invoke a httpHandler, or fire off on a different thread.

    HttpHandler would be my preferred option, as it is easier to debug ;)

  • Casey Neehouse 1339 posts 483 karma points MVP 2x admin
    Jan 11, 2010 @ 06:35
    Casey Neehouse
    0

    I have a task run async from an action handler.  The problem is you loose context of the current session, thus, you can not publish documents, etc.  There are ways around it, such as setting the publish at to publish immediately, or as slace pointed out, create a HttpHandler or Web Service to handle some of the task (as the http context is added back into the mix).

    I think this should be reported as a bug, as the context should not be necessary in these cases, imo.

    Case

Please Sign in or register to post replies

Write your reply to:

Draft