Skip to content

spago run hangs with get #150

Open
Open
@yaitskov

Description

@yaitskov

Hi,

An application process using get function doesn't terminate even all activities completed i.e.
there is no pending promises, set timers.

spago init
spago install affjax
npm install xhr2
module Main where

import Prelude (Unit, bind, discard, (<>))

import Effect (Effect)
import Effect.Console as EC -- (log)
import Effect.Class.Console (log)
import Affjax (get, printError)
import Data.Either (Either(..))
import Affjax.ResponseFormat (string)
import Effect.Aff (Aff, launchAff_)

my :: Aff Unit
my = do
  r <- get string "http://ya.ru"
  case r of
    Right rr -> log ("response body: " <> rr.body)
    Left e -> log ("OOPS Error " <> printError e)

main :: Effect Unit
main = do
  launchAff_ do
    my
  EC.log "HELLO"

spago build
spago run

Request body is printed but process stays alive forever.
If I replace get request with simple logging then process terminates as expected.

my :: Aff Unit
my = do
  log ("HELLO" <> " " <> "WORLD")

spago version 0.15.3
affjax v10.1.0
xhr2 "0.2.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions