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

Escher has start/Reactive errors on Julia 0.5 #116

Closed
dioptre opened this issue Jan 30, 2016 · 10 comments
Closed

Escher has start/Reactive errors on Julia 0.5 #116

dioptre opened this issue Jan 30, 2016 · 10 comments
Labels

Comments

@dioptre
Copy link

dioptre commented Jan 30, 2016

I'm finding it difficult to get going :(

Can someone push me in the right direction please?

MethodError: :start has no method matching start(30::Reactive.Signal{Any}
) in setup_socket at /home/a/.julia/v0.5/Escher/src/cli/serve.jl:48
in anonymous at /home/a/.julia/v0.5/Escher/src/cli/serve.jl:229
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:15
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:8
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:15
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:8
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:15
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:8
in toresponse at /home/a/.julia/v0.5/Mux/src/basics.jl:47
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:8
in splitquery at /home/a/.julia/v0.5/Mux/src/basics.jl:28
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:8
in basiccatch at /home/a/.julia/v0.5/Mux/src/basics.jl:78
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:8
in todict at /home/a/.julia/v0.5/Mux/src/basics.jl:21
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:12 (repeats 3 times)
in anonymous at /home/a/.julia/v0.5/Mux/src/Mux.jl:8
in anonymous at /home/a/.julia/v0.5/Mux/src/server.jl:31
[inlined code] from /home/a/.julia/v0.5/HttpServer/src/HttpServer.jl:100
in on_message_complete at /home/a/.julia/v0.5/HttpServer/src/HttpServer.jl:400
in on_message_complete at /home/a/.julia/v0.5/HttpServer/src/RequestParser.jl:104

_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "?help" for help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.5.0-dev+2333 (2016-01-27 20:32 UTC)
/ |_'|||__'| | Commit 91dcdaa* (2 days old master)
|__/ | x86_64-pc-linux-gnu

julia> Pkg.status("Escher")

  • Escher 0.3.0+ master (dirty)

julia> Pkg.status("Reactive")

  • Reactive 0.3.0 master

julia> Pkg.status("Mux")

  • Mux 0.2.0

julia> Pkg.status("Patchwork")

  • Patchwork 0.2.1+ master (dirty)

julia>

@dioptre
Copy link
Author

dioptre commented Jan 30, 2016

I wonder if this has something to do with it...
Request(:/, 16 headers, 0 bytes in body)AAAAGGHH/nRequest(:/, 16 headers, 0 bytes in body)
Error handling websocket connection:
MethodError: getindex has no method matching getindex(::HttpCommon.Request, ::Symbol)
in splitquery at /home/a/.julia/v0.5/Mux/src/basics.jl:25

@dioptre
Copy link
Author

dioptre commented Jan 30, 2016

So the requests from the websockets are looking like this as above: Request(:/, 16 headers, 0 bytes in body)

I add this to server.jl:


uisocket(dir) = (req) -> begin
    file = joinpath(abspath(dir), (req[:params][:file]))

    d = query_dict(req[:query])

    w = @compat parse(Int, d["w"])
    h = @compat parse(Int, d["h"])

    sock = req[:socket]
    tilestream = Signal(Signal, Signal(Tile, empty))

    # TODO: Initialize window with session,
    # window dimensions and what not

    window = Window(dimension=(w*px, h*px))
 ##NEW!!!!!!
   if issubtype(typeof(window.assets), Signal)    
    warn("Request appeared as a bogus socket!")
        # Replace the current main signal
        swap!(tilestream, window.assets)
    return;
    end

    for asset in window.assets
    write(sock, JSON.json(import_cmd(asset))) 
    end
    main = loadfile(file)

And this to mux/src/basics:

function splitquery(app, req)
 ##NEW!!!!!!
 if !issubtype(typeof(req), Dict ) #&& !haskey(req, :resource)
    warn("Unhandled Request: ", req)
    req = todict(req)
    req[:socket] = "/";
  end
  uri = URI(req[:resource])
  delete!(req, :resource)
  req[:path]  = splitpath(uri.path)
  req[:query] = uri.query
  app(req)
end

It seems there is a websocket request that is getting confused for a normal request and is shutting everything down. I made these fixes - but only a blank web-page....

Any help appreciated! :)

@dioptre
Copy link
Author

dioptre commented Jan 30, 2016

...can report escher working on 0.4 though... no c++ support until 0.5 though! :)

@zznop
Copy link

zznop commented Feb 1, 2016

@dioptre can you test mc.jl on 0.4. It loads for me but when I click the "start button" it only triggers about 10% of the time. I often need to refresh and click start multiple times to get it to execute.

See my last two comments on issue #114

@dioptre
Copy link
Author

dioptre commented Feb 9, 2016

Have you tried it recently @r2dbg? I think it might be fixed in the newest revision.

@zznop
Copy link

zznop commented Feb 17, 2016

@dioptre I have tried it recently and it is still not working. Does mc.jl work as expected for you? To this day, with the fully updated version of Escher on 0.4.3, the button only works about 10% of the time, and requires multiple page refreshes. I've tried on multiple machines, and multiple browsers. I can't get mc.jl in the examples folder to run correctly (and as such my custom apps that use a mc.jl-like abstraction for interactive web forms)

@dioptre
Copy link
Author

dioptre commented Feb 18, 2016

@r2dbg I'm using it successfully on 0.4.2 and it works ok!? I tried the examples, and found that everything worked after the most recent update that @shashi made.

@zznop
Copy link

zznop commented Feb 18, 2016

@dioptre I'm on commit 4dd34f3 on 0.4.3 and am still having issues with mc.jl. In most cases it will run for me the first time when I set the slider and click process. However, when I go to reset the slider to another value and click process again, it won't work (unless I refresh). I'll look into it more, thanks for checking it out!

@randyzwitch
Copy link
Contributor

Is this still an issue @dioptre or @brandonkmiller?

@shashi
Copy link
Member

shashi commented Apr 13, 2016

So I think we should close this issue and start a new meta issue for 0.5-only issues #141.

@shashi shashi closed this as completed Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants