arunthampi-evented_net 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/README.rdoc +21 -23
  2. metadata +1 -1
@@ -8,30 +8,28 @@ The aim of this library is to make a consistent API for both synchronous and eve
8
8
 
9
9
  == Sample Code which uses EventedNet::HTTP POST call
10
10
 
11
- <pre>
12
- require 'rubygems'
13
- require 'evented_net'
14
- require 'evma_httpserver'
15
- require 'cgi'
11
+ require 'rubygems'
12
+ require 'evented_net'
13
+ require 'evma_httpserver'
14
+ require 'cgi'
16
15
 
17
- class Handler < EventMachine::Connection
18
- include EventMachine::HttpServer
16
+ class Handler < EventMachine::Connection
17
+ include EventMachine::HttpServer
19
18
 
20
- def process_evented_http_req(code, body)
21
- puts "Code: #{code} Body: #{body}"
22
- end
19
+ def process_evented_http_req(code, body)
20
+ puts "Code: #{code} Body: #{body}"
21
+ end
23
22
 
24
- def process_http_request
25
- uri = URI.parse('http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi')
26
- EventedNet::HTTP.post(uri, :callback => method(:process_evented_http_req), :params => {:Comments => 'Testing Attention Please'})
23
+ def process_http_request
24
+ uri = URI.parse('http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi')
25
+ EventedNet::HTTP.post(uri, :callback => method(:process_evented_http_req), :params => {:Comments => 'Testing Attention Please'})
26
+ end
27
27
  end
28
- end
29
-
30
- EventMachine::run {
31
- # When running on Mac OS X, use EventMachine.kqueue
32
- # When running on Linux 2.6.x kernels, use EventMachine.epoll
33
- EventMachine.kqueue
34
- EventMachine::start_server("0.0.0.0", 8082, Handler)
35
- puts "Listening"
36
- }
37
- </pre>
28
+
29
+ EventMachine::run {
30
+ # When running on Mac OS X, use EventMachine.kqueue
31
+ # When running on Linux 2.6.x kernels, use EventMachine.epoll
32
+ EventMachine.kqueue
33
+ EventMachine::start_server("0.0.0.0", 8082, Handler)
34
+ puts "Listening"
35
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arunthampi-evented_net
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arun Thampi