Skip to content
  • Rosa Gutierrez's avatar
    62e05ce9
    Allow updating the database selector context with the response · 62e05ce9
    Rosa Gutierrez authored
    Currently the database selector middleware only passes the request to
    the context.
    
    This is enough for the resolver to decide whether to switch
    to the primary, but for a custom resolver and a custom context class,
    it's not enough to persist any information for subsequent requests. For
    example, say you want to use a cookie to decide whether when to switch.
    It's not possible to set the response cookie from this middleware, since
    neither the context nor the resolver have access to it.
    
    This includes an extra step to update the context after the response has
    been computed.
    62e05ce9
    Allow updating the database selector context with the response
    Rosa Gutierrez authored
    Currently the database selector middleware only passes the request to
    the context.
    
    This is enough for the resolver to decide whether to switch
    to the primary, but for a custom resolver and a custom context class,
    it's not enough to persist any information for subsequent requests. For
    example, say you want to use a cookie to decide whether when to switch.
    It's not possible to set the response cookie from this middleware, since
    neither the context nor the resolver have access to it.
    
    This includes an extra step to update the context after the response has
    been computed.
Loading