moduleNetwork.Wai.Handler.Warp.SettingswhereimportControl.ExceptionimportControl.MonadimportqualifiedData.ByteStringasSimportData.ConduitimportData.Conduit.Network(HostPreference(HostIPv4))importNetwork.WaiimportNetwork.Wai.Handler.Warp.TimeoutimportNetwork.Wai.Handler.Warp.TypesimportSystem.IO(hPrint,stderr)-- | Various Warp server settings. This is purposely kept as an abstract data-- type so that new settings can be added without breaking backwards-- compatibility. In order to create a 'Settings' value, use 'defaultSettings'-- and record syntax to modify individual records. For example:---- > defaultSettings { settingsTimeout = 20 }dataSettings=Settings{settingsPort::Int-- ^ Port to listen on. Default value: 3000,settingsHost::HostPreference-- ^ Default value: HostIPv4,settingsOnException::SomeException->IO()-- ^ What to do with exceptions thrown by either the application or server. Default: ignore server-generated exceptions (see 'InvalidRequest') and print application-generated applications to stderr.,settingsOnOpen::IO()-- ^ What to do when a connection is open. Default: do nothing.,settingsOnClose::IO()-- ^ What to do when a connection is close. Default: do nothing.,settingsTimeout::Int-- ^ Timeout value in seconds. Default value: 30,settingsIntercept::Request->Maybe(Source(ResourceTIO)S.ByteString->Connection->ResourceTIO()),settingsManager::MaybeManager-- ^ Use an existing timeout manager instead of spawning a new one. If used, 'settingsTimeout' is ignored. Default is 'Nothing',settingsFdCacheDuration::Int-- ^ Cache duratoin time of file descriptors in seconds. 0 means that the cache mechanism is not used. Default value: 10,settingsResourceTPerRequest::Bool-- ^ If @True@, each request\/response pair will run in a separate-- @ResourceT@. This provides more intuitive behavior for dynamic code,-- but can hinder performance in high-throughput cases. File servers can-- safely set to @False@ for increased performance. Default is @True@.}-- | The default settings for the Warp server. See the individual settings for-- the default value.defaultSettings::SettingsdefaultSettings=Settings{settingsPort=3000,settingsHost=HostIPv4,settingsOnException=\e->casefromExceptioneofJustx->goxNothing->when(go'$fromExceptione)$hPrintstderre,settingsOnOpen=return(),settingsOnClose=return(),settingsTimeout=30,settingsIntercept=constNothing,settingsManager=Nothing,settingsFdCacheDuration=10,settingsResourceTPerRequest=True}wherego::InvalidRequest->IO()go_=return()go'(JustThreadKilled)=Falsego'_=True