System.Ben icon indicating copy to clipboard operation
System.Ben copied to clipboard

Replace ConfigureAwait(false) with ConfigureAwait(ben)

Open danielmarbach opened this issue 8 years ago • 5 comments

I was exploring the code and came to the conclusion that YOU are doing it wrong.

With the introduction of #66 the code will be sprinkled with ConfigureAwait(false) but that is totally wrong! We should stop capturing Ben instead of the context! So I suggest we introduce ConfigureAwait(ben). Thoughts?

danielmarbach avatar Mar 24 '17 11:03 danielmarbach

I used it once. The continuation was dispatched on the IOBP (IOBenPort) thread. Are you sure you want to do it @danielmarbach ?

Scooletz avatar Mar 24 '17 11:03 Scooletz

Of course! Here is my rough draft

public async Ben Awesome(string itis) {
   await Food().ConfigureAwait(ben);
}

It will be using the Ben Continuation model. It will also be possible to write arbitrary ben-like types.

Everything will be dispatched with the BenScheduler. Paging in @stephentoub and @ljw1004 to get this going!

danielmarbach avatar Mar 24 '17 12:03 danielmarbach

I just had an amazing revelation. With arbitrary ben-like types, I can write System.Daniel, write an arbitrary ben-like type and then

I CAN BECOME BEN!

MUAHAHAHAHA

danielmarbach avatar Mar 24 '17 12:03 danielmarbach

I think we need anonymous Ben types (we can start with his alter ego ;-))

karelz avatar Mar 25 '17 04:03 karelz

we can start with his alter ego

Mild mannered reporter ;-)

benaadams avatar Mar 26 '17 17:03 benaadams