I have a WCF service, marked with the OperationContract attribute.
I have a potentially long running task I want to perform when this operation is carried out, but I don’t want the caller (in this case Silverlight) to have to wait for that to complete.
What is my best option for this?
I was thinking of either
- something like the OnActionExecuted method of
ActionFilterAttibuteinSystem.Web.Mvc, but couldn’t see an equivilent. - something listening to an event. (The process I want to call is a static, so I’m not too sure about this approach)
- something else:
In the scenario I’m working in, I lock the app so the user cannot make any changes during the save until I get the response (a status code) back.
Keep in mind, Silverlight won’t actually have to ‘wait’ for the call to finish. When you create a service reference within Silverlight you will automatically get async calls.
Assuming you really don’t need to wait for the call to finish (ie: your service method uses a ‘void’ return type) you can mark the service method as one-way via: