packet 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -3
- data/lib/packet.rb +1 -1
- data/lib/packet/packet_connection.rb +1 -1
- data/lib/packet/packet_master.rb +2 -2
- data/lib/packet/packet_nbio.rb +2 -9
- metadata +19 -19
data/README
CHANGED
@@ -62,8 +62,6 @@ Packet::Reactor.run do |t_reactor|
|
|
62
62
|
t_reactor.connect("en.wikipedia.org",80,WikiHandler)
|
63
63
|
end
|
64
64
|
|
65
|
-
=== Using Callbacks and Deferables
|
66
|
-
Documentation to come.
|
67
65
|
|
68
66
|
=== Using Workers
|
69
67
|
Packet enables you to write simple workers, which will run in
|
@@ -229,7 +227,7 @@ end
|
|
229
227
|
to start a worker as usual. It should
|
230
228
|
be noted that, forking a worker, which is already
|
231
229
|
forked can be disastrous, since worker names are being
|
232
|
-
used as unique keys that represent a worker.
|
230
|
+
used as unique keys that represent a worker.Test
|
233
231
|
|
234
232
|
== Performance:
|
235
233
|
Although written in pure ruby, packet performs
|
data/lib/packet.rb
CHANGED
@@ -46,7 +46,7 @@ module Packet
|
|
46
46
|
|
47
47
|
def ask_worker(*args)
|
48
48
|
worker_name = args.shift
|
49
|
-
data_options =
|
49
|
+
data_options = args.last
|
50
50
|
data_options[:client_signature] = connection.fileno
|
51
51
|
t_worker = reactor.live_workers[worker_name]
|
52
52
|
raise Packet::InvalidWorker.new("Invalid worker with name #{worker_name} and key #{data_options[:data][:worker_key]}") unless t_worker
|
data/lib/packet/packet_master.rb
CHANGED
@@ -108,8 +108,8 @@ module Packet
|
|
108
108
|
[master_write_end,master_read_end].each { |x| x.close }
|
109
109
|
[worker_read_end,worker_write_end].each { |x| enable_nonblock(x) }
|
110
110
|
begin
|
111
|
-
if(ARGV[0] == 'start' &&
|
112
|
-
log_file = File.open(
|
111
|
+
if(ARGV[0] == 'start' && Object.const_defined?(:SERVER_LOGGER))
|
112
|
+
log_file = File.open(SERVER_LOGGER,"a+")
|
113
113
|
[STDIN, STDOUT, STDERR].each {|desc| desc.reopen(log_file)}
|
114
114
|
end
|
115
115
|
rescue; end
|
data/lib/packet/packet_nbio.rb
CHANGED
@@ -13,15 +13,8 @@ module Packet
|
|
13
13
|
def read_data(t_sock)
|
14
14
|
sock_data = []
|
15
15
|
begin
|
16
|
-
|
17
|
-
|
18
|
-
sock_data << t_data
|
19
|
-
end
|
20
|
-
else
|
21
|
-
while(t_data = t_sock.recv_nonblock((16*1024)-1))
|
22
|
-
raise DisconnectError.new(t_sock,sock_data.join) if t_data.empty?
|
23
|
-
sock_data << t_data
|
24
|
-
end
|
16
|
+
while(t_data = t_sock.read_nonblock((16*1024)-1))
|
17
|
+
sock_data << t_data
|
25
18
|
end
|
26
19
|
rescue Errno::EAGAIN
|
27
20
|
return sock_data.join
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hemant Kumar
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-10-04 00:00:00 +05:30
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -30,34 +30,34 @@ files:
|
|
30
30
|
- TODO
|
31
31
|
- lib/packet
|
32
32
|
- lib/packet/disconnect_error.rb
|
33
|
-
- lib/packet/
|
34
|
-
- lib/packet/
|
35
|
-
- lib/packet/
|
36
|
-
- lib/packet/packet_core.rb
|
37
|
-
- lib/packet/packet_helper.rb
|
38
|
-
- lib/packet/packet_parser.rb
|
33
|
+
- lib/packet/packet_pimp.rb
|
34
|
+
- lib/packet/packet_invalid_worker.rb
|
35
|
+
- lib/packet/packet_connection.rb
|
39
36
|
- lib/packet/packet_guid.rb
|
37
|
+
- lib/packet/double_keyed_hash.rb
|
38
|
+
- lib/packet/packet_master.rb
|
39
|
+
- lib/packet/packet_parser.rb
|
40
40
|
- lib/packet/packet_periodic_event.rb
|
41
41
|
- lib/packet/packet_callback.rb
|
42
|
-
- lib/packet/timer_store.rb
|
43
|
-
- lib/packet/packet_pimp.rb
|
44
|
-
- lib/packet/packet_master.rb
|
45
42
|
- lib/packet/packet_worker.rb
|
46
|
-
- lib/packet/
|
47
|
-
- lib/packet/packet_invalid_worker.rb
|
43
|
+
- lib/packet/packet_core.rb
|
48
44
|
- lib/packet/packet_meta_pimp.rb
|
49
|
-
- lib/packet/
|
50
|
-
- lib/
|
45
|
+
- lib/packet/packet_mongrel.rb
|
46
|
+
- lib/packet/packet_helper.rb
|
47
|
+
- lib/packet/timer_store.rb
|
48
|
+
- lib/packet/packet_event.rb
|
49
|
+
- lib/packet/packet_nbio.rb
|
51
50
|
- lib/packet.rb
|
52
|
-
-
|
53
|
-
- examples/sample_server.rb
|
51
|
+
- lib/packet_mongrel.rb
|
54
52
|
- examples/concurrent_thread.c
|
53
|
+
- examples/sample_server.rb
|
55
54
|
- examples/write_bulk.rb
|
56
55
|
- examples/asteroid.h
|
57
56
|
- examples/persistent_print.rb
|
58
57
|
- examples/use_stuff.rb
|
59
|
-
- examples/asteroid.c
|
60
58
|
- examples/extconf.h
|
59
|
+
- examples/asteroid.c
|
60
|
+
- examples/extconf.rb
|
61
61
|
has_rdoc: true
|
62
62
|
homepage: http://code.google.com/p/packet/
|
63
63
|
post_install_message:
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements: []
|
81
81
|
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 1.
|
83
|
+
rubygems_version: 1.3.0
|
84
84
|
signing_key:
|
85
85
|
specification_version: 2
|
86
86
|
summary: Packet, A Pure Ruby library for Event Driven Network Programming.
|