Ajai,
 
Yeah, I've been thinking of doing something along the lines you
proposed, but this approach has serious flaws.
Who calls the actual EndFoo methods? What happends when it throws?
 
Krzysztof

>>> [email protected] 2009-05-09 16:06 >>>


>From your Prepare snippet, looks like the model for the client code is
still callback based.

How about using a BeginInvoke extension method?

proxy
    .BeginInvoke(p => p.GetSize(str))
    .EndInvoke(size => Write(size));

This calling pattern sets up some context for your proxy/interceptor
directing it to call BeginGetSize instead of GetSize.

The client then can control if the call is going to be synchronous or
asynchronous based on its need.

You might find a coroutine approach such as F# async or my
http://www.codeplex.com/EasyAsync interesting too.

Cheers

Ajai

On May 6, 2:47 pm, Krzysztof Ko*mic <[email protected]>
wrote:
> I'm working on adding to WCF Facility support for async calls from
> client side (similar to what can be done with SvcUtil-generated
> proxies), when using channelfactory and intereface contract only.
> Something like What Ayende wrote about
here:http://ayende.com/Blog/archive/2008/03/29/WCF-Async-without-proxies.aspx
> but without having to write IAsyncBus
>
> I have very rough (but working) implementation.
>
> But...
>
> given we don't have an actual async methods to call, we have to have
an
> alternative syntax (well, at least until C# 4.0 and IDynamicObject,
but
> that's another story)http://paste2.org/p/198506here's what I came up
with.
> I encourage you to discussion about it. If you have alternative,
better
> ideas, you can show it here:http://paste2.org/followup/198506
>
> Thanks,
>
> Krzysztof





CONFIDENTIALITY NOTICE
This message is intended exclusively for the individual or entity to which it 
is addressed. This communication may contain information that is proprietary, 
privileged, confidential or otherwise legally exempt from disclosure. If you 
are not the named addressee, you are not authorized to read, print, retain, 
copy or disseminate this message or any part of it. If you have received this 
message in error, please delete all copies of this message and notify the 
sender immediately by return mail or fax ATSI S.A.(+4812) 285 36 04.
Any email attachment may contain software viruses which could damage your own 
computer system. Whilst reasonable precaution has been taken to minimise this 
risk, we cannot accept liability for any damage which you sustain as a result 
of software viruses. You should therefore carry out your own virus checks 
before opening any attachments.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to