An open source non-blocking (asynchronous) Ruby web server framework, powered by an EventMachine reactor, a high-performance HTTP parser and Ruby 1.9 runtime.
Questions tagged [goliath]
39 questions
11
votes
1 answer
Rails app and goliath api and database/models sharing
I'm trying to create async api with Goliath framework. Service should write to mysql, add messages to RabbitMQ and receive responses back. There also should be a separate admin application built with Rails. I have several questions about that:
Is…

gayavat
- 18,910
- 11
- 45
- 55
9
votes
4 answers
using the postgresql gem async
I'm using Goliath (which is powered by eventmachine) and the postgres gem pg, currently I'm using the pg gem in a blocking way: conn.exec('SELECT * FROM products') (for example) and I'm wondering whether there is a better way to connect to a…

errorhandler
- 1,757
- 3
- 22
- 29
4
votes
1 answer
How do Goliath or EventMachine switch context?
Assume I have an I/O-bounded operations. I do have a callbacks (or em-synchrony)
How does EM switch to proccess next request keeping previous one waiting for callback?
How does it keep Thread.current variables isolated?
How can I emulate long…

Sergii Mostovyi
- 1,361
- 1
- 15
- 19
3
votes
2 answers
Suggested Redis driver for use within Goliath?
There seem to be several options for establishing Redis connections for use within EventMachine, and I'm having a hard time understanding the core differences between them.
My goal is to implement Redis within Goliath
The way I establish my…

Marco
- 4,345
- 6
- 43
- 77
2
votes
1 answer
Async web processing using Goliath
I need a a simple webserver which parses the url it receives, calls som other ruby scripts which do some heavy processing and thereafter return the resulting JSON.
Is Goliath appropriate for this? As far as I can see the requests are being handled…

user1204271
- 131
- 1
- 4
2
votes
1 answer
Goliath on Openshift
Trying to deploy a Goliath application on Openshift with the below config.ru
require 'goliath'
require './goliathapp'
runner = Goliath::Runner.new(ARGV, nil)
runner.api = GoliathApp.new
runner.app = Goliath::Rack::Builder.build(GoliathApp,…

Vangelis Typaldos
- 83
- 5
2
votes
1 answer
Goliath not being asynchronous
I am running a simple goliath server on my localhost with Ruby 1.9.3, and it's not running http requests asynchronously. Here's the code:
require 'goliath'
require 'em-synchrony'
require 'em-synchrony/em-http'
class Server < Goliath::API
use…

Kenny Meyer
- 7,849
- 6
- 45
- 66
2
votes
1 answer
New Relic integration with goliath
I have configured New Relic with goliath as explained here
I am using gem 'newrelic_rpm', but not getting stats at newrelic service.

Raghvendra Parashar
- 3,883
- 1
- 23
- 36
2
votes
2 answers
is there a way to modify or send custom headers on grape?
I'm using Goliath and Grape. On my goliath server it calls the grape api like so:
when '/posts' then FrameworksAPI::API.call(env)
On my grape api class, my method is as simple as this:
get '/:id' do
Post.find(params[:id])
end
I'd like to modify…

David
- 4,235
- 12
- 44
- 52
1
vote
1 answer
How do Ruby Goliath applications actually start?
This is an example from Goliath:
require 'goliath'
class HelloWorld < Goliath::API
def response(env)
[200, {}, "hello world"]
end
end
How does defining a class and subclassing Goliath::API results in a web server being started? Shouldn't…

CodingWithSpike
- 42,906
- 18
- 101
- 138
1
vote
1 answer
How to achieve strong parameter protection without Rails?
I am developing a boilerplate web application with Goliath + Grape + Active Record 4.2 + Active Record Migrations. Here is my migration file
# db/migrate/20150519063210_create_albums.rb
class CreateAlbums < ActiveRecord::Migration
def change
…

Aetherus
- 8,720
- 1
- 22
- 36
1
vote
0 answers
Silencing errors in Grape/Goliath
I'm working with a Grape API running on Goliath. Currently, if a method returns an error for some reason, the client receives a 500 – and the exact error raised!
How can I silence the output from the API and just have it return a generic 500 error?

henryaj
- 31
- 4
1
vote
1 answer
Access Rails models inside a different module
I'm writing a web service for my Rails app using Goliath and I want to log all the requests sent to my web server. I have this Api class which is inside two modules:
require 'goliath'
module WebService
module Rest
class Api < Goliath::API
…

Pedram Behroozi
- 2,447
- 2
- 27
- 48
1
vote
0 answers
how to get Goliath::Runner instance port in Goliath?
I am trying to grab server's port outside a request controller in Goliath, which means I cannot access env['SERVER_PORT'].
So I tried to parse ARGV, turns out it's empty
I found there's a port property of Goliath::Runner, but how to refer to the…

λq_
- 362
- 2
- 10
1
vote
0 answers
Goliath + Redis: Testing sequence of requests
I wrote an endpoint that has two operations: PUT and GET. GET retrieves what was PUT, so a good way to ensure both work would be to test them in sequence.
My cURL testing tells me the service works. However, I can't get my test that does the same…

elsurudo
- 3,579
- 2
- 31
- 48