ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.RubyGems.Handlers.Budget

Description

Native requests pass the edge check and admission, run under the serve-path cap, and bound actual upstream chunks and examined source documents independently.

Synopsis

Documentation

withNativeRequest :: (ServeRuntime -> (ResponseHeaders -> Handler ResponseReceived) -> (MemoryTicket -> Handler a) -> (a -> Handler ResponseReceived) -> Handler ResponseReceived) -> Request -> (RubyResponse -> Handler ResponseReceived) -> (PackumentDeps -> a) -> (MemoryTicket -> PackumentDeps -> Handler a) -> (a -> Handler ResponseReceived) -> Handler ResponseReceived Source #

Refuse a caller the edge does not authorise, then run action under admit and the serve-path cap, answering expired once the cap passes and handing the result to continue.

newNativeReadBudget :: Int -> IO (Int -> IO ()) Source #

Refuse before another source chunk reaches its parser when cumulative input exceeds the cap.

newNativeDocumentBudget :: Int -> response -> IO (Int -> IO (Either response ())) Source #

Refuse before admission when examined source documents, including cache hits, exceed the cap.