kenichi / angelo

Sinatra-like DSL for Reel that supports WebSockets and SSE
Other
303 stars 23 forks source link

Angelo crashes using reel 0.6.x #52

Closed mighe closed 9 years ago

mighe commented 9 years ago

Hi @kenichi, I was trying angelo with reel 0.6.0.pre1 and I get the following error:

NameError: uninitialized constant WebSocket::Message
    /xxx/angelo-ef0d4892d865/lib/angelo/base.rb:274:in `block (3 levels) in <class:Base>'
    /xxx//angelo-ef0d4892d865/lib/angelo/stash.rb:88:in `block in all_each'
    /xxx/angelo-ef0d4892d865/lib/angelo/stash.rb:86:in `each'
    /xxx/angelo-ef0d4892d865/lib/angelo/stash.rb:86:in `all_each'
    /xxx/angelo-ef0d4892d865/lib/angelo/base.rb:273:in `block (2 levels) in <class:Base>'

the problem is here: the code is using a class from the old websocket parser, that has been removed with the websocket-driver integration.

kenichi commented 9 years ago

ah, it looks like the new websocket-driver stuff does not expose the driver. since websocket-driver has its own ping, we should attempt to use that, eh?

kenichi commented 9 years ago

whoa, the new stuff depends on rack and uses Rack::MockRequest?

digitalextremist commented 9 years ago

I see this too, and it bothered me. It's coming over by websocket-driver as you said. I've not wanted Rack anywhere near Reel or any DSL it supports. I will look into this also.

mighe commented 9 years ago

@digitalextremist do you think it could be useful to have a ping method exposed by Reel? At the moment the only way @kenichi has is to use directly a Reel dependency and this could lead to unexpected problems in the future (like this one). If pinging a websocket is a useful feature for many developers, having it integrated in Reel is probably the best thing.

digitalextremist commented 9 years ago

@mighe we can expose ping ( forwarding to ping on @driver ) no problem.

kenichi commented 9 years ago

my immediate fix was to add :driver to the attr_accessor list, but then i saw the mockrequest and went down a rabbit hole of trying to make reel work without that.

kenichi commented 9 years ago

@digitalextremist :+1:

digitalextremist commented 9 years ago

Yeah I am going to make it work without Rack again. I swear there should be a C in front of Rack because every now and then someone keeps getting us hooked again. And it's all in good fun and everyone is having a rad party committing stuff, and then it's like :bomb: Rack reappeared muahahaha

kenichi commented 9 years ago

@digitalextremist @mighe see https://github.com/celluloid/reel/pull/188

kenichi commented 9 years ago

see also https://github.com/kenichi/angelo/compare/reel_0.6

digitalextremist commented 9 years ago

If we clean this up and make sure it's solid, I'll cut a pre2 with this in, while we wait on UNIX sockets.

kenichi commented 9 years ago

much has been done as a result of this issue, thanks @mighe.