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

@ sync broken on julia 1.0 #73

Closed
abannsunny opened this issue Sep 30, 2018 · 5 comments
Closed

@ sync broken on julia 1.0 #73

abannsunny opened this issue Sep 30, 2018 · 5 comments

Comments

@abannsunny
Copy link

abannsunny commented Sep 30, 2018

on julia 1.0 even after defining @sync serve(app, 8000) julia just exits right away after the server is started.

but if i run the script file in the REPL it doesn't exit and the server keeps listening to the defined port.

I switched to julia-0.6.2 and it works as expected.

Thank you

@amgad-naiem
Copy link
Contributor

amgad-naiem commented Sep 30, 2018

@abannsunny This is fixed in #71 using fetch(serve(app, port))

@abannsunny
Copy link
Author

abannsunny commented Sep 30, 2018

Status C:\Users\abann\.julia\environments\v1.0\Project.toml
[c43c736e] Genie v0.1.0 #master (https://github.com/essenciary/Genie.jl)
[a975b10e] Mux v0.5.3
[f269a46b] TimeZones v0.8.0

using fetch(serve(app, 7777))

still exits out. Am I missing something? this is my code.

using Mux

@app test = (
  Mux.defaults,
  page(respond("<h1>Hello World!</h1>")),
  page("/about",
       probabilty(0.9, respond("<h1>Boo!</h1>")),
       respond("<h1>About Me</h1>")),
  page("/user/:user", req -> "<h1>Hello, $(req[:params][:user])!</h1>"),
  Mux.notfound())

  println("server started")


  fetch(serve(test, 7777))


@amgad-naiem
Copy link
Contributor

@abannsunny PR not merged yet.

@emgrasmeder
Copy link

In the mean time, until the PR is closed, you can put Base.JLOptions().isinteractive==0 && wait() at the bottom of the program.

This should work:

using Mux

@app test = (
  Mux.defaults,
  page(respond("<h1>Hello World!!!!</h1>")),
  page("/about",
       probabilty(0.1, respond("<h1>Boo!</h1>")),
       respond("<h1>About Me</h1>")),
  page("/user/:user", req -> "<h1>Hello, $(req[:params][:user])!</h1>"),
  Mux.notfound())

serve(test)
Base.JLOptions().isinteractive==0 && wait()

@jpsamaroo
Copy link
Collaborator

Fixed by #71 and #74 I believe.

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

5 participants