Safe Haskell | None |
---|---|
Language | Haskell2010 |
Configuration and settings for the server. All constructor names are exported, but notice that they start with an underscore. They also have an equivalent lens without the underscore. Please prefer to use the lens interface.
- sessionId :: Functor f => (Int -> f Int) -> SessionCoordinates -> f SessionCoordinates
- defaultSessionsConfig :: SessionsConfig
- defaultSessionsEnrichedHeaders :: SessionsEnrichedHeaders
- sessionsCallbacks :: Lens' SessionsConfig SessionsCallbacks
- sessionsEnrichedHeaders :: Lens' SessionsConfig SessionsEnrichedHeaders
- reportErrorCallback_SC :: Lens' SessionsCallbacks (Maybe ErrorCallback)
- dataDeliveryCallback_SC :: Lens' SessionsCallbacks (Maybe DataFrameDeliveryCallback)
- newSessionCallback_SC :: Lens' SessionsCallbacks (Maybe NewSessionCallback)
- dataFrameSize :: Lens' SessionsConfig Int
- addUsedProtocol :: Iso' SessionsEnrichedHeaders Bool
- pushEnabled :: Lens' SessionsConfig Bool
- firstPushStream :: Lens' SessionsConfig Int
- networkChunkSize :: Lens' SessionsConfig Int
- trayMaxSize :: Lens' SessionsConfig Int
- data SessionComponent
- newtype SessionCoordinates = SessionCoordinates Int
- data SessionsCallbacks = SessionsCallbacks {}
- data SessionsEnrichedHeaders = SessionsEnrichedHeaders {}
- data SessionsConfig = SessionsConfig {}
- data SessionGenericHandle where
- Whole_SGH :: (ActivityMeteredSession a, CleanlyPrunableSession a) => a -> SessionGenericHandle
- Partial_SGH :: ActivityMeteredSession a => a -> IOCallbacks -> SessionGenericHandle
- type ErrorCallback = (SessionComponent, SessionCoordinates, SomeException) -> IO ()
- type DataFrameDeliveryCallback = Int -> Int -> Int -> TimeSpec -> IO ()
- newtype NewSessionCallback = NewSessionCallback (HashableSockAddr -> SessionGenericHandle -> forall a. a -> IO ())
- data HashableSockAddr
- class ActivityMeteredSession a where
- sessionLastActivity :: a -> IO TimeSpec
- class CleanlyPrunableSession a where
- cleanlyCloseSession :: a -> IO ()
Documentation
sessionId :: Functor f => (Int -> f Int) -> SessionCoordinates -> f SessionCoordinates
Get/set a numeric Id from a SessionCoordinates
. For example, to
get the session id with this, import `Control.Lens.(^.)` and then do
session_id = session_coordinates ^. sessionId
defaultSessionsConfig :: SessionsConfig
Creates a default sessions context. Modify as needed using the lenses interfaces
defaultSessionsEnrichedHeaders :: SessionsEnrichedHeaders
Don't insert any extra-headers by default.
data SessionComponent
Components at an individual session. Used to report where in the session an error was produced. This interface is likely to change in the future, as we add more metadata to exceptions
newtype SessionCoordinates
Information used to identify a particular session.
data SessionsCallbacks
Callbacks that you can provide your sessions to notify you of interesting things happening in the server.
SessionsCallbacks | |
|
This is a temporal interface, but an useful one nonetheless. By setting some values here to True, second-transfer will add some headers to inbound requests, and some headers to outbound requests.
This interface is deprecated in favor of the AwareWorker functionality....
SessionsEnrichedHeaders | |
|
data SessionsConfig
Configuration information you can provide to the session maker.
SessionsConfig | |
|
data SessionGenericHandle where
An object with information about a new session, wrapped in a weak pointer. At the time the newSessionCallback_SC is invoked, the reference inside the weak pointer is guranteed to be alive. It may die later though.
Whole_SGH :: (ActivityMeteredSession a, CleanlyPrunableSession a) => a -> SessionGenericHandle | |
Partial_SGH :: ActivityMeteredSession a => a -> IOCallbacks -> SessionGenericHandle |
type ErrorCallback = (SessionComponent, SessionCoordinates, SomeException) -> IO ()
Used by this session engine to report an error at some component, in a particular session.
type DataFrameDeliveryCallback = Int -> Int -> Int -> TimeSpec -> IO ()
Used by the session engine to report delivery of each data frame. Keep this callback very light, it runs in the main sending thread. It is called as f session_id stream_id ordinal when_delivered
newtype NewSessionCallback
Callback to be invoked when a client establishes a new session. The first parameter is the address of the client, and the second parameter is a controller that can be used to reduce the number of connections from time to time, the third parameter is a key on which the second paramter should be made a weak pointer
NewSessionCallback (HashableSockAddr -> SessionGenericHandle -> forall a. a -> IO ()) |
data HashableSockAddr
Since SockAddr is not hashable, we need our own. TODO: IPv6.
class ActivityMeteredSession a where
Sessions follow this class, so that they can be rescinded on inactivity
sessionLastActivity :: a -> IO TimeSpec