benaadams / System.Ben

Who says you can't be super fast and super secure
MIT License
142 stars 23 forks source link

Replace ConfigureAwait(false) with ConfigureAwait(ben) #83

Open danielmarbach opened 7 years ago

danielmarbach commented 7 years ago

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?

Scooletz commented 7 years ago

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

danielmarbach commented 7 years ago

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 commented 7 years ago

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

karelz commented 7 years ago

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

benaadams commented 7 years ago

we can start with his alter ego

Mild mannered reporter ;-)