Send ports for pages as they're completed.

This commit is contained in:
Dillon Kearns 2020-10-13 21:46:08 -07:00
parent ad0059037a
commit 8a24e858d2
2 changed files with 10 additions and 11 deletions

View File

@ -262,10 +262,9 @@ perform cliMsgConstructor toJsPort effect =
]
|> toJsPort
|> Cmd.map never
--, Task.succeed ()
-- |> Task.perform (\_ -> Continue)
-- |> Cmd.map cliMsgConstructor
, Task.succeed ()
|> Task.perform (\_ -> Continue)
|> Cmd.map cliMsgConstructor
]
Effect.Continue ->
@ -564,8 +563,8 @@ update contentCache siteMetadata config msg model =
-- Debug.log "Continuing..." (List.length model.unprocessedPages)
updatedModel =
model
|> popProcessedRequest
--|> popProcessedRequest
nextToProcess =
drop1 model
in
@ -641,7 +640,8 @@ nextStepToEffect contentCache config model nextStep =
in
case siteMetadata of
Ok pages ->
pages
model.unprocessedPages
|> List.take 1
--|> Debug.log "@@@ pages"
|> List.map
(\( page, metadata ) ->
@ -766,9 +766,9 @@ nextStepToEffect contentCache config model nextStep =
--|> Effect.SendSinglePage
)
|> Effect.Batch
|> (\cmd -> ( model, cmd ))
--|> (\cmd -> ( model, cmd ))
|> (\cmd -> ( model |> popProcessedRequest, cmd ))
--|> (\cmd -> ( model |> popProcessedRequest, cmd ))
--( model, Effect.NoEffect )
Err error ->
--todo (toString error)

View File

@ -279,9 +279,8 @@ simulateEffects effect =
[ info
|> Codec.encoder ToJsPayload.successCodecNew
|> SimulatedEffect.Ports.send "toJsPort"
--, SimulatedEffect.Task.succeed ()
-- |> SimulatedEffect.Task.perform (\_ -> Main.Continue)
, SimulatedEffect.Task.succeed ()
|> SimulatedEffect.Task.perform (\_ -> Main.Continue)
]
Effect.Continue ->