Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected executing halt #214

Closed
tryggvigy opened this issue Aug 6, 2017 · 4 comments
Closed

Unexpected executing halt #214

tryggvigy opened this issue Aug 6, 2017 · 4 comments

Comments

@tryggvigy
Copy link

tryggvigy commented Aug 6, 2017

I'm fiddling around with reasonml and ocaml core.

Problem

image
But the output should be:

I print
I don't

It seems like open Async.Std; halts executing some how.

I tried to find related issues but found nothing.
This looks like a issue but maybe I am missing something trivial?

Source files

jbuild

(jbuild_version 1)

(executable
 ((name main)
  (libraries (core async))
  (preprocess (pps (ppx_jane)))
 ))

main.re

open Core.Std;
print_endline "I print";
open Async.Std;
print_endline "I don't";

@anemator
Copy link

anemator commented Aug 6, 2017

I don't think this is a jbuilder issue. Try calling never_returns (Scheduler.go ()) at the end of the file. You can use Control-C to exit when it blocks.

From RealWorldOCaml:

One of the most common newbie errors with Async is to forget to run the scheduler. It can be a bewildering mistake, because without the scheduler, your program won't do anything at all; even calls to printf won't reach the terminal.

@tryggvigy
Copy link
Author

Aha! Thanks @anemator. This was my issue

@anemator
Copy link

anemator commented Aug 6, 2017

You're welcome.

@dra27
Copy link
Member

dra27 commented Aug 6, 2017

Do head over to our Discourse forum if you need any more help 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants