views:

26

answers:

0

I'm migrating a project to the MVC 2.0 RTM version, and have hit a snag. I have a couple of asynchronous controllers based upon the older MVCfutures (1.0.0.0)

This previous release let me do very clean asynchronous methods (see below for example)

EDIT: Work around was to retain the previous futures version. Need a solution moving forward though

What happened to the support for this pattern? Can It be reinstated?
Does anyone have any work arounds?

    [Authorize()]
    public Func<ActionResult> Status(int ID)
    {
        var task = new GetTask(ID, GetUserName());
        AsyncManager.OutstandingOperations.Increment();
        MySettings.Tasks.Post(task);
        ImportTaskItem importtask = null;
        Activate(task.responsePort.Receive(
            entity =>
            {
                importtask = new Models.ImportTaskItem((ImportTask)entity);
                AsyncManager.OutstandingOperations.Decrement();
            }));

        return () =>
        {
            if (importtask != null)                
                return Json(importtask, JsonRequestBehavior.AllowGet);                
            return Json("No Task", JsonRequestBehavior.AllowGet);
        };
    }

Found a forum post which seems to suggest it was dropped in favour of the events pattern - not impressed!