I have an ASP.NET page that needs to be returned to call data for many web services. I want to run these requests in parallel, and using the PageAsyncTask class seems to be the most appropriate way to do this. The trick is that there are five calls - A, B, C, D, and E. Call A & A B should be done sequentially, as in C & amp; D. AB pair, CD pair, and E can run in all parallel.
It does not appear that I can use the "executeInParallel" parameter of the PageAsyncTask constructor to create 5 functions, the parallel / sequential configuration.
I have tried to do 3 things, two of which have asynchronous calls (as is) when I try to do this in the context of a PageSyncTask, I get an error stating that The end function can only be called once. I have tried to wrap a chain set of 3 functions in a pair of functions, which uses PageSyncTask, and as a result the end function is never being called (a timeout like this).
Is there a good way to do this?
EDIT: If this is useful, then here is a simplified version of the code that I am trying to get and the error that the end function can be called only once.
SAFE sub Page_Load (ByVal as this object, ByVal e As System.EventArgs) Handles as Me.Load dim objMB New BusObject.AsyncTasks (AddressOf dummy) dim objTask New as PageAsyncTask (AddressOf objMB.BeginStartSession, AddressOf objMB.EndGetList, nothing, nothing, it's true) RegisterAsyncTask (objTask) I dimmed as integer = 0 End Sub public class BusObject public class AsyncState public SecondCallback AsyncCallback End Class Orbit AsyncTasks Dim Fn_Callback PageCallback Public Representative Sub PageCallback (ByVal objData Object As as) Public Sub New (ByVal fnCallback as Pejkelbak) fn_Callback = fn callback and all public as the function started Krenstart session (object, IV as I new Sinkstet objX.SecondCallback = cb Return objWS.BeginWSFunction1 ( "param1", "param2", Ptaoprstartsteshn session, objX) end function public sub endStart session (as IAsyncResult as Byval objAsyncResult) Dim objWS new com.WebService Dim strSessionKey string = objWS. EndJSATCs (objAsyncResult) angkcast = objAsyncResult.AsyncState objWS.BeginWSFunction2 ("p1", "p2", "p5", "p4", "p5", strsessionkey, true, objstate.Second callback, objState) end objstate sub as Andgetlist (Aiaisaianskearslt by Objhstet) nd as dim objWS ew com.WebService dim objResult as com.WebService.Result = objWS.EndWSFunction2 (objState) dim lstReturn new list (BusObject of) fn_Callback (lstReturn) end Sub end Class - itemprop = "text"
after
Comments
Post a Comment