Goliath runner

40 views
Skip to first unread message

Peter Kieltyka

unread,
Oct 3, 2011, 4:47:02 PM10/3/11
to Goliath.io
Hey guys,

I've been trying to examples/custom_server.rb file to use the Goliath
Runner.. but even this example doesnt seem to work.

Hitting an endpoint returns:

/Users/peter/Development/other/goliath/lib/goliath/connection.rb:36:in
`block (2 levels) in post_init': undefined method `set_event_handler!'
for nil:NilClass (NoMethodError)

...this is because the "api" parameter is nil. Which appears to be
correct. It makes sense that for a custom runner, I shouldn't need the
Goliath::API and a Rack app... no?

Peter

Ilya Grigorik

unread,
Oct 3, 2011, 10:40:48 PM10/3/11
to golia...@googlegroups.com
Hey Peter. Yep, someone reported this as a bug.. I think we introduced a regression in our recent refactor of the routing logic. 


ig

Peter Kieltyka

unread,
Oct 3, 2011, 10:54:33 PM10/3/11
to golia...@googlegroups.com
Ahh cool. It's actually a 1 line fix from what I can see.. I tried it and it seemed to work, but I still don't understand the distinction between "api" and "app" in the runner.

connection.rb on line 36

+...@api.set_event_handler!(env) if @api
-...@api.set_event_handler!(env)

Peter Kieltyka

unread,
Oct 4, 2011, 9:45:51 AM10/4/11
to golia...@googlegroups.com
Btw.. a cool addition to the runner would be to have socket support.. this works great:

opts.on('-S', '--socket FILE', "Bind to unix domain socket") {|v| @options[:address] = v; @options[:port] = nil }

On 2011-10-03, at 10:40 PM, Ilya Grigorik wrote:

dan sinclair

unread,
Oct 4, 2011, 11:04:43 AM10/4/11
to golia...@googlegroups.com
That's cool, can you send it as a pull request and I'll merge it in?

Thanks,
dan
Reply all
Reply to author
Forward
0 new messages