platform/lib/src/middleware_pipeline.dart

21 lines
509 B
Dart
Raw Normal View History

2016-11-25 23:22:33 +00:00
import 'router.dart';
2016-12-19 04:43:55 +00:00
/// A chain of arbitrary handlers obtained by routing a path.
2016-11-25 23:22:33 +00:00
class MiddlewarePipeline {
2016-12-19 04:43:55 +00:00
/// All the possible routes that matched the given path.
2016-11-25 23:22:33 +00:00
final List<RoutingResult> routingResults;
2016-12-19 04:43:55 +00:00
/// An ordered list of every handler delegated to handle this request.
2016-11-25 23:22:33 +00:00
List get handlers {
final handlers = [];
for (RoutingResult result in routingResults) {
handlers.addAll(result.allHandlers);
}
return handlers;
}
MiddlewarePipeline(this.routingResults);
}