class Telecr::Core::Composer

Overview

Composer runs a chain of middleware and finally executes a handler. Updated to be more efficient with Crystal's Proc handling.

Defined in:

core/composer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def clear #

[View source]
def empty? : Bool #

[View source]
def run(ctx : Context, &final : Context -> ) #

Run the middleware chain and final handler


[View source]
def size : Int32 #

[View source]
def use(middleware : Middleware) #

Add middleware to the chain


[View source]
def use(&block : Context, Context -> -> ) #

Overload to allow adding middleware as a block for quicker development


[View source]