def add_middleware(middleware: EFBMiddleware):
    """
    Register a middleware with the coordinator.

    Args:
        middleware (EFBMiddleware): Middleware to register
    """
    global middlewares
    if isinstance(middleware, EFBMiddleware):
        middlewares.append(middleware)
    else:
        raise TypeError("Middleware instance is expected")