nbarbettini / BeautifulRestApi

Beautiful REST API design with ASP.NET Core and Ion
Apache License 2.0
605 stars 145 forks source link

Is there any reason why there's CancellationToken in every controller action? #11

Closed bugproof closed 6 years ago

bugproof commented 6 years ago

Those actions are mostly short-running. Does it add any benefit?

nbarbettini commented 6 years ago

Good point, it's probably not as useful with how short-running these actions are. I wanted to demonstrate the correct pattern of passing a CancellationToken through the layers from ASP.NET Core -> actions -> database/network code. It certainly can be removed if you don't need to handle cancellation mid-request.

bugproof commented 6 years ago

So it's not that useful in this case? Alright ;)