-
-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
Imagine a vanilla rails app, where controller actions might look like:
class SomeController < ApplicationController
def update
response = request_handler.do_post("https://microsoft.com/update_thing", params[:post_body])
render json: response.body
end
def request_handler
@_request_handler ||= RequestHandler.new
end
end
and RequestHandler
something like:
class RequestHandler
def do_post(url, body)
task = Async do
conn.post(url) do |req|
req.body = body
end
end
response = task.wait
end
def conn
Faraday.new do |c|
c.adapter :async_http
end
end
end
the app is using falcon host
or falcon virtual
with the rack
configuration, a preload of the rails environment, and endpoint Async::HTTP::Endpoint.parse("http://0.0.0.0:3000")
. pretty simple.
Originally posted by @jakeonfire in #32 (comment)
Metadata
Metadata
Assignees
Labels
No labels