Custom instances of HStream impossible to write
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- haskell
- Ambito
- networking
Direzione di ricerca
Inizia da HStream, HandleStream, openStream, close e openTCPConnection in Network.TCP, quindi esamina hstreamToConnection e Connection in Network.Stream. Determina un’API che consenta alle istanze HStream personalizzate di chiudere il proprio HandleStream senza I/O lazy né dipendere dalla conversione specifica per String. Il lavoro è completato quando un tipo di buffer personalizzato può definire una pulizia esplicita della connessione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
It would be nice to be able to have an instance of HStream that allows to stream without using lazy I/O; in particular, an instance that would allow us to close the connection when we no longer want the rest of the response body.
However, in order to define a custom type with a corresponding HStream instance one needs to provide, amongst other things, implementations of
openStream :: String -> Int -> IO (HandleStream bufType)
close :: HandleStream bufType -> IO ()
For the implementation of openStream we can use
openTCPConnection :: BufferType ty => String -> Int -> IO (HandleStream ty)
However, for the implementation of close we are stuck; there is no function analogous to openTCPConnection that allows us to close a HandleStream.
Although we have
hstreamToConnection :: HandleStream String -> Connection
and there is a Stream instance for Connection, hstreamToConnection works only for HandleStream String, so that doesn't help either.
Finally, the HandleStream type is completely opaque (it does not even satisfy Functor) so we cannot define a HStream instance for one bufType in terms of the HStream instance for another. If we had some way of defining new instances in terms of old instances (for instance, reuse the instance for lazy bytestrings, but somehow retain a handle to the corresponding HandleStream so that we can close it explicitly) that would be great.
- Lingua principale
- Haskell
- Stelle
- 186
- Fork
- 59
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di haskell/HTTP
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 55/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di haskell/HTTP
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
enhancement tricorder
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
zip-archive-0.5 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
commercialhaskell/stackage#8124 · 1 commento ·