cognitedata / oryx

.NET Cross platform and highly composable middleware for building web request handlers in F#
Apache License 2.0
202 stars 10 forks source link

Simplify OnNextAsync #83

Closed dbrattli closed 3 years ago

dbrattli commented 3 years ago

Simplify OnNextAsync by making content non-optional. This removes the need for having to pattern match in every handler. In many cases the content needed to be unit for handlers and unit option feels unnecessary.

Also make choose operator trigger on error instead of success. I.e it will continue to the next handler as long as the current handler produces error. This allows for handlers to not produce output and still be considered successful.

codecov[bot] commented 3 years ago

Codecov Report

Merging #83 (b76d2e0) into master (0be296d) will decrease coverage by 1.42%. The diff coverage is 65.62%.

@@            Coverage Diff             @@
##           master      #83      +/-   ##
==========================================
- Coverage   79.02%   77.59%   -1.43%     
==========================================
  Files           9        9              
  Lines         715      732      +17     
  Branches       14       13       -1     
==========================================
+ Hits          565      568       +3     
- Misses        143      157      +14     
  Partials        7        7              
Impacted Files Coverage Δ
src/Middleware/Builder.fs 0.00% <0.00%> (ø)
src/HttpHandler/Logging.fs 70.70% <55.55%> (+0.11%) :arrow_up:
src/Middleware/Core.fs 79.48% <62.90%> (-11.22%) :arrow_down:
src/HttpHandler/HttpHandler.fs 75.62% <65.85%> (+1.83%) :arrow_up:
src/Middleware/Error.fs 87.93% <85.71%> (-0.41%) :arrow_down:
src/HttpHandler/Builder.fs 88.88% <100.00%> (ø)