question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

True Async / Await Support

See original GitHub issue

Just a brief question as I didn’t see documentation on testing async code. Is this the correct way to do so in MSpec?

Because of = async () => await EventManager.Raise(_Event).Await().AsTask;
or
Because of = () => EventManager.Raise(_Event).Await();

If so, why was this decision made over simply detecting Task or Task<T> return types and waiting till completion before invoking It delegates. I understand void return types make dealing with SynchronizationContext a pain, but the majority of the time, developers shouldn’t be writing async void methods to begin with. Is this more difficult to do than I’m alluding or is it more-so related to backwards compatibility?

It certainly feels worse not trusting the calling method (MSpec) to await.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
robertcoltheartcommented, Jun 3, 2020

I’m currently maintaining mspec, and it’s on the plans for 2.0, but nothing concrete yet, follow here: #293

1reaction
danielmarbachcommented, Jun 1, 2020

Hi, I’m not involved anymore with mspec. I wasn’t for a long time. Maybe someone else can comment here

Read more comments on GitHub >

github_iconTop Results From Across the Web

async function - JavaScript - MDN Web Docs - Mozilla
The async function declaration creates a binding of a new async function to a given name. The await keyword is permitted within the...
Read more >
Async/await
There's a special syntax to work with promises in a more comfortable fashion, called “async/await”. It's surprisingly easy to understand and ...
Read more >
Python async await on condition being true
I'm trying to write an asynchronous method to run a query on hive (using pyhive). Now, pyhive does support asynchronous querying, I have...
Read more >
Asynchronous support
Asynchronous support ¶. Django has support for writing asynchronous (“async”) views, along with an entirely async-enabled request stack if you are running ...
Read more >
Even with async/await, raw promises are still key to writing ...
Writing truly concurrent code is occasionally not possible, or easy, with pure async/await. Writing code for the browser? Isn't that a solved problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found