News for hackers. Stuff that matters.
Re:Interview with Ryan Dahl, Creator of Node.js by thomasz on Thursday August 31, 2017 @03:40PM (#15143232)
It's hardly the fault of the language if people are lying in their method signatures. I'm not aware of a mainstream PL with a type system that is powerful enough to avoid something like that.
Re:Interview with Ryan Dahl, Creator of Node.js by nulagrithom on Thursday August 31, 2017 @05:08PM (#15143933)
In this case, the .NET-provided base class defaults to using the synchronous version when the async version hasn't been overridden.

https://msdn.microsoft.com/en-us/library/system.data.common....

> Providers should implement this method to provide a non-default implementation for ExecuteReader overloads.

> The default implementation invokes the synchronous ExecuteReader method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by ExecuteReader will be communicated via the returned Task Exception property.

Found that after several hours of tearing my hair out trying to figure out why my async calls were still blocking...

Re:Interview with Ryan Dahl, Creator of Node.js by int_19h on Friday September 01, 2017 @06:25AM (#15147321)
This is a bug in the library. The correct way to do these "async but not really" wrappers is to call the synchronous implementation in a separate thread pool worker thread, and wrap that into a task (as Task.Run does). This is hardly optimal perf-wise, but it is truly asynchronous wrt to the caller. If I remember correctly, it's what Stream does for its default implementations of async methods.