c# - Is Rx under 3.5SP1 forward-compatible with Rx and TPL under 4.0? -
i want begin enabling our c# .net 3.5sp1 project's code asynchrony. primary use case invoke wcf services asynchronously.
our wcf service layer entirely interface-based, interface method signatures imply implementations assumed execute synchronously (e.g. somedatacontract getsomedatacontractbyid(someid id);
. i'd avoid retrofitting plethora of interfaces support asynchronous execution .net framework asynchronous pattern of iasyncresult
, beginoperation
/endoperation
. want more manageable way this.
we use t4 templates generate lot of code, i'd able generate asynchronous version of interface based on synchronous one. implementation of asynchronous interface invoke wcf service asynchronously, ideally using .net 4.0's tpl's task<t>
represent operation task , returning caller. problem .net 3.5sp1 has no such tpl , hence no nice task<t>
.
what options here, keeping in mind compatibility between .net 3.5sp1 , .net 4.0? i'm open dropping task<t>
(if misunderstand purpose) in favor of else that's cross-compatible between 2 frameworks, maybe rx?
rx's api (nearly) identical on 3.5 vs 4.0 (the difference being ischeduler queues tasks). rx great choice here, because let stub wcf service calls in realistic way:
return observable.return(stubobject).delay(timespan.frommilliseconds(750));
Comments
Post a Comment