|
1 | 1 | module Grip |
2 | 2 | module Handlers |
3 | 3 | class Pipeline < Base |
4 | | - CACHED_PIPES = {} of Array(Symbol) => Array(Middleware::Base) |
| 4 | + CACHED_PIPES = {} of Array(Symbol) => Array(::HTTP::Handler) |
5 | 5 |
|
6 | | - property pipeline : Hash(Symbol, Array(Middleware::Base)) |
| 6 | + property pipeline : Hash(Symbol, Array(::HTTP::Handler)) |
7 | 7 | property http_handler : ::HTTP::Handler? |
8 | 8 | property websocket_handler : ::HTTP::Handler? |
9 | 9 |
|
10 | 10 | def initialize( |
11 | 11 | @http_handler = nil, |
12 | 12 | @websocket_handler = nil, |
13 | 13 | ) |
14 | | - @pipeline = Hash(Symbol, Array(Middleware::Base)).new |
| 14 | + @pipeline = Hash(Symbol, Array(HTTP::Handler)).new |
15 | 15 | end |
16 | 16 |
|
17 | 17 | def add_route( |
@@ -44,19 +44,19 @@ module Grip |
44 | 44 | @http_handler = http_handler |
45 | 45 | @websocket_handler = websocket_handler |
46 | 46 |
|
47 | | - handlers = @pipeline[valve] ||= Array(Middleware::Base).new |
| 47 | + handlers = @pipeline[valve] ||= Array(::HTTP::Handler).new |
48 | 48 | handlers << pipe |
49 | 49 | handlers[-2]?.try &.next = pipe |
50 | 50 | end |
51 | 51 |
|
52 | | - def get(valve : Symbol) : Array(Middleware::Base)? |
| 52 | + def get(valve : Symbol) : Array(::HTTP::Handler)? |
53 | 53 | @pipeline[valve]? |
54 | 54 | end |
55 | 55 |
|
56 | | - def get(valves : Array(Symbol)) : Array(Middleware::Base) |
| 56 | + def get(valves : Array(Symbol)) : Array(::HTTP::Handler) |
57 | 57 | return CACHED_PIPES[valves] if CACHED_PIPES.has_key?(valves) |
58 | 58 |
|
59 | | - pipes = Array(Middleware::Base).new |
| 59 | + pipes = Array(::HTTP::Handler).new |
60 | 60 |
|
61 | 61 | valves.each do |valve| |
62 | 62 | @pipeline[valve]?.try &.each { |pipe| pipes << pipe } |
|
0 commit comments