<commit_before>{-# OPTIONS_HADDOCK hide #-}
module SecondTransfer.Http2.MakeAttendant (
    http2Attendant
    ) where


import           SecondTransfer.Http2.Framer            (wrapSession)
import           SecondTransfer.Sessions.Internal       (SessionsContext)
import           SecondTransfer.MainLoop.CoherentWorker
import           SecondTransfer.MainLoop.PushPullType   (Attendant)

-- | The type of this function is equivalent to:
--
-- @
--      http2Attendant :: CoherentWorker -> AttendantCallbacks ->  IO ()
-- @
--
-- Given a `CoherentWorker`, this function wraps it with flow control, multiplexing,
-- and state maintenance needed to run an HTTP/2 session.
--
-- Notice that this function is  using HTTP/2 over TLS. We haven't implemented yet
-- a session handling mechanism for HTTP/1.1 .
http2Attendant :: SessionsContext -> AwareWorker -> Attendant
http2Attendant sessions_context coherent_worker attendant_callbacks = do
    let
        attendant = wrapSession coherent_worker sessions_context
    attendant attendant_callbacks
<commit_msg>Updated a corner in the docs<commit_after>{-# OPTIONS_HADDOCK hide #-}
module SecondTransfer.Http2.MakeAttendant (
    http2Attendant
    ) where


import           SecondTransfer.Http2.Framer            (wrapSession)
import           SecondTransfer.Sessions.Internal       (SessionsContext)
import           SecondTransfer.MainLoop.CoherentWorker
import           SecondTransfer.MainLoop.PushPullType   (Attendant)

-- |
-- 
-- Given an `AwareWorker`, this function wraps it with flow control, multiplexing,
-- and state maintenance needed to run an HTTP/2 session.
--
-- Notice that this function is  using HTTP/2 over TLS. There is an equivalent for HTTP 
-- 1.1. 
http2Attendant :: SessionsContext -> AwareWorker -> Attendant
http2Attendant sessions_context coherent_worker attendant_callbacks = do
    let
        attendant = wrapSession coherent_worker sessions_context
    attendant attendant_callbacks

{'fraction_non_alphanumeric': 0.07266260162601626, 'fraction_numerical': 0.009654471544715448, 'mean_word_length': 3.225321888412017, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1551373', 'n_tokens_mistral': 539, 'n_tokens_neox': 511, 'n_words': 160}