Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Provide MxAgents with a dual state model

Abierto
#307 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@hyperthunk ya está trabajando en esto.

Desde el 13/2/2017.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Feature Request In Progress

It's often the case that whilst initialising an agent might need to wait on other actors, so we should either copy the init >>= serve model from client-server, or provide a dual state monadic environment so we don't have code like this...

data AgentState = Booting | ActualState { f1 = ..., f2 = ... }

-- and inside a listener
startIt = mxAgent agentId Booting [ mxSink handlePeersReady, mxSink handleEvent ]
where
  handleEvent Booting = mxSkip 
  handleEvent ActualState{...} = ...

And worse still, have to worry about the boot state when you're buried in implementation code...

forwardToServer _   HBAgentBoot = liftMX terminate  -- state invariant
forwardToServer ev' HBAgent{ hbServer = sPid }
                                = liftMX (send sPid ev') >> mxReady

handleRestarts _   HBAgentBoot = liftMX terminate   -- state invariant
handleRestarts pid sta@HBAgent{ hbServer = sPid' }
        | pid == sPid' = restartBoth sta
        | otherwise    = mxReady

On the other hand, we want this API to remain as simple as possible, since here we're providing service and utility, and policy belongs elsewhere.

Lenguaje dominante
Haskell
Estrellas
753
Forks
101
Merge medio
1 d 3 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de haskell-distributed/distributed-process

Todos los issues de haskell-distributed/distributed-process

Issues similares

Más issues de Haskell

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.