Skip to content
This repository was archived by the owner on Dec 7, 2018. It is now read-only.

add server access from requests#228

Open
kenichi wants to merge 1 commit into
celluloid:masterfrom
kenichi:server_accessor
Open

add server access from requests#228
kenichi wants to merge 1 commit into
celluloid:masterfrom
kenichi:server_accessor

Conversation

@kenichi

@kenichi kenichi commented Jun 25, 2016

Copy link
Copy Markdown
Contributor
  • add server = nil param to +Connection+ initializer
  • add self to +Connection+ construction in +Server+
  • add @server reader on +Connection+
  • add @connection reader on +Request+
  • add test for above

this gives a developer easy access to the server reactor instance from each request.

Reel::Server::HTTP.new('127.0.0.1',4567) do |c|
  c.each_request do |r|
    r.connection.server.after(3){ puts 'hi 3 seconds later' }
    r.respond :ok, 'wait for it...'
  end
end

* add `server = nil` param to +Connection+ initializer
* add `self` to +Connection+ construction in +Server+
* add `@server` reader on +Connection+
* add `@connection` reader on +Request+
* add test for above
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants