Support different de/serialization strategies
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
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- haskell
- Ambito
- distributed-systems
Direzione di ricerca
Inizia leggendo l’astrazione Process attuale e il punto di ingresso send per capire come è collegata la serializzazione basata su Binary. Confronta questa API con la strategia Serialize proposta e con MimeRender/MimeUnrender di Servant; il lavoro sarebbe completato quando si sarà raggiunto un accordo sull’astrazione e saranno aggiornati i tipi e gli esempi interessati senza rompere i programmi agnostici rispetto alla serializzazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Currently, all messages are de/serialized via the Binary instance.
This is an implementation detail; there is strict required beyond the existence of two functions, encode :: a -> ByteString and decode :: ByteString -> Either String a. However, discussions in the DataHaskell group have raised the point that serialization for data science structures (e.g. dataframes) could be made more efficient by leveraging Parquet over the wire.
I'm thinking of an extension of the current Process monad, to support also a de/serialization strategy. This is strongly inspired by Servant's MimeRender and MimeUnrender classes. Consider:
newtype Process strategy a = Process ... -- Monad is unchanged, type has a new `strategy`
class Serialize strategy a where
encode :: Proxy strategy -> a -> ByteString
decode :: Proxy strategy -> ByteString -> Either String a
An example for JSON would be:
import Data.Aeson
data JSON
class (ToJSON a, FromJSON a) => Serialize JSON a where
encode _ = encode
decode _ = eitherDecodeStrict
Then, for the actual message sending e.g. via send, the type would become:
send :: Serialize strategy a => ProcessId -> a -> Process strategy ()
Then, programs that are agnostic of serialization are of type Process strategy a (instead of Process a), while programs which require a specific serialization method, such as JSON, will be of type Process JSON a.
- Lingua principale
- Haskell
- Stelle
- 753
- Fork
- 101
- Merge medio
- 1g 3h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
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-distributed/distributed-process
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
enhancement Feature Request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
haskell-distributed/distributed-process#486 · 1 commento · 1 reazione ·
-
enhancement Feature Request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
haskell-distributed/distributed-process#476 · 2 reazioni ·
-
Demonstrating the use of Cloud Haskell for a Raft implementationForse di nuovo libera @LaurentRDC l’ha presa 481 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement Feature Request
haskell-distributed/distributed-process#475 · 3 reazioni · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
haskell-distributed/distributed-process#473 · 4 commenti · 1 reazione ·
Tutte le issue di haskell-distributed/distributed-process
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NixOS/nixpkgs-update#586 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
koalaman/shellcheck#3593 ·
-
Make node sockets moduleApertaconfiguration
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
tweag/cardano-kosmos#47 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
objectionary/phino#2021 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 3 giorni