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

add server access from requests #228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kenichi
Copy link
Member

@kenichi kenichi commented Jun 25, 2016

  • 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