Is that client or service code? I don’t know if I use a threadpool or not. I just create the service, run slSvcUtil and it generates all the proxy code for me. Then I do what I showed before. If that uses “a threadpool” or not, beats me. But it works.
Now I’m really struggling with what has to be done where and how. Like I’ve gone to a new language.
Assuming your code is on the client, is the “exit GetData(args)” supposed to be the WCF call? If it is, I don’t think I can do that as it requires a GetDataAsync in the generated code. No?
Not sure which part of the 9000 line file you want to see. I usually don’t look into the generated file. I just use the proxy.
I think this might be the type of thing you are asking for:
method GuardianEditObservationServiceClient.GetPeopleAsync(dataConnectionKey: System.String; userState: System.Object);
begin
if (self.onBeginGetPeopleDelegate = nil) then begin
self.onBeginGetPeopleDelegate := new BeginOperationDelegate(@self.OnBeginGetPeople);
end;
if (self.onEndGetPeopleDelegate = nil) then begin
self.onEndGetPeopleDelegate := new EndOperationDelegate(@self.OnEndGetPeople);
end;
if (self.onGetPeopleCompletedDelegate = nil) then begin
self.onGetPeopleCompletedDelegate := new System.Threading.SendOrPostCallback(@self.OnGetPeopleCompleted);
end;
inherited InvokeAsync(self.onBeginGetPeopleDelegate, array of System.Object([dataConnectionKey]), self.onEndGetPeopleDelegate, self.onGetPeopleCompletedDelegate, userState);
end;
Don’t get me started on Microsoft dropping Silverlight I wish there were something else as good, but I haven’t seen anything that I like as much and no time to convert to ANYTHING at the moment anyway.
I think I’m going to have to drop this whole idea. It just seems too complicated to figure out in the time I have. The link wasn’t for Silverlight and it wasn’t clear I could go down that path with SL. It talked about SvcUtil and I have to use SLSvcUtil. So not sure what they are talking about will even work.
I was hoping there was something in the Oxygene async and await that would help me, but I can’t figure enough out from the little examples I’ve seen in the Wiki.