Permalink
Browse files

Updating to be sexier

  • Loading branch information...
1 parent d144dbd commit 899d605790ae5591c0ed7b896ceb342d238ffced @localshred committed Sep 15, 2010
Showing with 186 additions and 19 deletions.
  1. +3 −1 Gemfile
  2. +6 −2 Gemfile.lock
  3. +154 −0 server.log
  4. +4 −4 server.rb
  5. +18 −12 user_client.rb
  6. +1 −0 user_service.rb
View
@@ -1,2 +1,4 @@
+source :rubygems
-gem 'ruby_protobuf', path: '/code/src/ruby-protobuf'
+gem 'eventmachine'
+gem 'ruby_protobuf', path: '/code/src/ruby_protobuf'
View
@@ -1,13 +1,17 @@
PATH
- remote: /code/src/ruby-protobuf
+ remote: /code/src/ruby_protobuf
specs:
- ruby_protobuf (0.4.0.1)
+ ruby_protobuf (0.4.0.2)
+ eventmachine
GEM
+ remote: http://rubygems.org/
specs:
+ eventmachine (0.12.10)
PLATFORMS
ruby
DEPENDENCIES
+ eventmachine
ruby_protobuf!
View
@@ -22,3 +22,157 @@ I, [2010-09-13T01:10:09.869319 #16953] INFO -- : [C] setting up client
I, [2010-09-13T01:10:09.869501 #16953] INFO -- : [C] calling client.find
E, [2010-09-13T01:10:09.872046 #16953] ERROR -- : Got client controller failure
E, [2010-09-13T01:10:09.872138 #16953] ERROR -- : Response Error: Connection refused - connect(2) (Errno::ECONNREFUSED) (BAD_REQUEST_DATA)
+I, [2010-09-15T00:53:02.534811 #31396] INFO -- : [S] Setting up server
+I, [2010-09-15T00:53:39.438093 #31415] INFO -- : [S] Setting up server
+I, [2010-09-15T00:55:30.574701 #31491] INFO -- : [S] Setting up server
+I, [2010-09-15T00:55:51.199319 #31506] INFO -- : [S] Setting up server
+I, [2010-09-15T00:55:58.201606 #31508] INFO -- : [C] setting up client
+I, [2010-09-15T00:55:58.201775 #31508] INFO -- : [C] calling client.find
+I, [2010-09-15T00:57:01.752918 #31534] INFO -- : [C] setting up client
+I, [2010-09-15T00:57:01.753092 #31534] INFO -- : [C] calling client.find
+I, [2010-09-15T00:57:52.204580 #31565] INFO -- : [C] setting up client
+I, [2010-09-15T00:57:52.204748 #31565] INFO -- : [C] calling client.find
+I, [2010-09-15T00:58:28.595558 #31583] INFO -- : [C] setting up client
+I, [2010-09-15T00:58:28.595740 #31583] INFO -- : [C] calling client.find
+I, [2010-09-15T00:58:47.736628 #31599] INFO -- : [C] setting up client
+I, [2010-09-15T00:58:47.736797 #31599] INFO -- : [C] calling client.find
+I, [2010-09-15T00:59:21.347190 #31615] INFO -- : [C] setting up client
+I, [2010-09-15T00:59:21.347359 #31615] INFO -- : [C] calling client.find
+I, [2010-09-15T00:59:45.322718 #31632] INFO -- : [C] setting up client
+I, [2010-09-15T00:59:45.322890 #31632] INFO -- : [C] calling client.find
+I, [2010-09-15T01:00:06.164918 #31647] INFO -- : [C] setting up client
+I, [2010-09-15T01:00:06.165083 #31647] INFO -- : [C] calling client.find
+I, [2010-09-15T01:00:24.348450 #31661] INFO -- : [C] setting up client
+I, [2010-09-15T01:00:24.348620 #31661] INFO -- : [C] calling client.find
+I, [2010-09-15T01:00:56.022531 #31690] INFO -- : [C] setting up client
+I, [2010-09-15T01:00:56.022699 #31690] INFO -- : [C] calling client.find
+I, [2010-09-15T01:01:10.720832 #31698] INFO -- : [C] setting up client
+I, [2010-09-15T01:01:10.721006 #31698] INFO -- : [C] calling client.find
+I, [2010-09-15T01:03:10.147651 #31790] INFO -- : [C] setting up client
+I, [2010-09-15T01:03:10.147822 #31790] INFO -- : [C] calling client.find
+I, [2010-09-15T01:13:36.687140 #32083] INFO -- : [S] Setting up server
+I, [2010-09-15T01:13:56.211654 #32094] INFO -- : [C] setting up client
+I, [2010-09-15T01:13:56.211825 #32094] INFO -- : [C] calling client.find
+I, [2010-09-15T01:20:24.221007 #32256] INFO -- : [S] Setting up server
+I, [2010-09-15T01:20:32.327111 #32258] INFO -- : [C] setting up client
+I, [2010-09-15T01:20:32.327278 #32258] INFO -- : [C] calling client.find
+I, [2010-09-15T01:27:43.984698 #32433] INFO -- : [S] Setting up server
+I, [2010-09-15T01:27:49.267540 #32435] INFO -- : [C] setting up client
+I, [2010-09-15T01:27:49.267703 #32435] INFO -- : [C] calling client.find
+I, [2010-09-15T01:28:56.557815 #32467] INFO -- : [C] setting up client
+I, [2010-09-15T01:28:56.557983 #32467] INFO -- : [C] calling client.find
+I, [2010-09-15T01:29:25.295644 #32483] INFO -- : [C] setting up client
+I, [2010-09-15T01:29:25.295816 #32483] INFO -- : [C] calling client.find
+I, [2010-09-15T01:31:12.758238 #32545] INFO -- : [C] setting up client
+I, [2010-09-15T01:31:12.758405 #32545] INFO -- : [C] calling client.find
+I, [2010-09-15T01:31:40.527109 #32562] INFO -- : [C] setting up client
+I, [2010-09-15T01:31:40.527284 #32562] INFO -- : [C] calling client.find
+I, [2010-09-15T01:32:11.994514 #32578] INFO -- : [C] setting up client
+I, [2010-09-15T01:32:11.994691 #32578] INFO -- : [C] calling client.find
+I, [2010-09-15T01:32:57.805180 #32602] INFO -- : [C] setting up client
+I, [2010-09-15T01:32:57.805351 #32602] INFO -- : [C] calling client.find
+I, [2010-09-15T01:34:01.231860 #32628] INFO -- : [C] setting up client
+I, [2010-09-15T01:34:01.232030 #32628] INFO -- : [C] calling client.find
+I, [2010-09-15T01:35:09.756688 #32684] INFO -- : [S] Setting up server
+I, [2010-09-15T01:35:41.262605 #32722] INFO -- : [S] Setting up server
+I, [2010-09-15T01:35:46.914849 #32730] INFO -- : [C] setting up client
+I, [2010-09-15T01:35:46.915020 #32730] INFO -- : [C] calling client.find
+I, [2010-09-15T01:36:59.150457 #32769] INFO -- : [C] setting up client
+I, [2010-09-15T01:36:59.150628 #32769] INFO -- : [C] calling client.find
+I, [2010-09-15T01:38:41.900531 #32818] INFO -- : [C] setting up client
+I, [2010-09-15T01:38:41.900700 #32818] INFO -- : [C] calling client.find
+I, [2010-09-15T01:39:30.709866 #32840] INFO -- : [C] setting up client
+I, [2010-09-15T01:39:30.710033 #32840] INFO -- : [C] calling client.find
+I, [2010-09-15T01:39:51.985608 #32856] INFO -- : [C] setting up client
+I, [2010-09-15T01:39:51.985775 #32856] INFO -- : [C] calling client.find
+I, [2010-09-15T01:40:23.346760 #32878] INFO -- : [C] setting up client
+I, [2010-09-15T01:40:23.346929 #32878] INFO -- : [C] calling client.find
+I, [2010-09-15T01:41:50.354839 #32920] INFO -- : [C] setting up client
+I, [2010-09-15T01:41:50.355008 #32920] INFO -- : [C] calling client.find
+I, [2010-09-15T01:43:38.082255 #32987] INFO -- : [C] setting up client
+I, [2010-09-15T01:43:38.082419 #32987] INFO -- : [C] calling client.find
+I, [2010-09-15T01:44:45.875636 #33018] INFO -- : [C] setting up client
+I, [2010-09-15T01:44:45.875805 #33018] INFO -- : [C] calling client.find
+I, [2010-09-15T01:45:29.145039 #33043] INFO -- : [C] setting up client
+I, [2010-09-15T01:45:29.145204 #33043] INFO -- : [C] calling client.find
+I, [2010-09-15T01:46:52.698066 #33080] INFO -- : [C] setting up client
+I, [2010-09-15T01:46:52.698237 #33080] INFO -- : [C] calling client.find
+I, [2010-09-15T01:49:50.074332 #33169] INFO -- : [C] setting up client
+I, [2010-09-15T01:49:50.074496 #33169] INFO -- : [C] calling client.find
+I, [2010-09-15T01:51:37.560178 #33218] INFO -- : [C] setting up client
+I, [2010-09-15T01:51:37.560347 #33218] INFO -- : [C] calling client.find
+I, [2010-09-15T01:52:34.573664 #33243] INFO -- : [C] setting up client
+I, [2010-09-15T01:52:34.573840 #33243] INFO -- : [C] calling client.find
+I, [2010-09-15T01:52:34.577739 #33243] INFO -- : IO_ERROR
+I, [2010-09-15T01:52:34.577805 #33243] INFO -- : nil
+I, [2010-09-15T01:53:27.992746 #33269] INFO -- : [C] setting up client
+I, [2010-09-15T01:53:27.992917 #33269] INFO -- : [C] calling client.find
+I, [2010-09-15T01:53:42.478617 #33284] INFO -- : [C] setting up client
+I, [2010-09-15T01:53:42.478793 #33284] INFO -- : [C] calling client.find
+I, [2010-09-15T01:53:51.284141 #33292] INFO -- : [C] setting up client
+I, [2010-09-15T01:53:51.284312 #33292] INFO -- : [C] calling client.find
+E, [2010-09-15T01:53:51.288328 #33292] ERROR -- : IO_ERROR
+E, [2010-09-15T01:53:51.288404 #33292] ERROR -- : Protobuf::Socketrpc::ErrorReason
+I, [2010-09-15T01:55:19.527829 #33338] INFO -- : [C] setting up client
+I, [2010-09-15T01:55:19.527996 #33338] INFO -- : [C] calling client.find
+E, [2010-09-15T01:55:19.531808 #33338] ERROR -- : IO_ERROR
+E, [2010-09-15T01:55:19.531906 #33338] ERROR -- : [:BAD_REQUEST_DATA, :BAD_REQUEST_PROTO, :SERVICE_NOT_FOUND, :METHOD_NOT_FOUND, :RPC_ERROR, :RPC_FAILED, :INVALID_REQUEST_PROTO, :BAD_RESPONSE_PROTO, :UNKNOWN_HOST, :IO_ERROR]
+I, [2010-09-15T01:56:13.304873 #33369] INFO -- : [C] setting up client
+I, [2010-09-15T01:56:13.305040 #33369] INFO -- : [C] calling client.find
+I, [2010-09-15T01:56:30.887242 #33379] INFO -- : [C] setting up client
+I, [2010-09-15T01:56:30.887415 #33379] INFO -- : [C] calling client.find
+I, [2010-09-15T01:57:45.505359 #33411] INFO -- : [C] setting up client
+I, [2010-09-15T01:57:45.505525 #33411] INFO -- : [C] calling client.find
+I, [2010-09-15T01:58:27.674949 #33436] INFO -- : [C] setting up client
+I, [2010-09-15T01:58:27.675117 #33436] INFO -- : [C] calling client.find
+I, [2010-09-15T01:58:46.919001 #33458] INFO -- : [S] Setting up server
+I, [2010-09-15T01:58:55.303833 #33459] INFO -- : [C] setting up client
+I, [2010-09-15T01:58:55.304001 #33459] INFO -- : [C] calling client.find
+I, [2010-09-15T01:59:41.617434 #33489] INFO -- : [S] Setting up server
+I, [2010-09-15T01:59:45.171197 #33491] INFO -- : [C] setting up client
+I, [2010-09-15T01:59:45.171369 #33491] INFO -- : [C] calling client.find
+I, [2010-09-15T02:00:28.340949 #33517] INFO -- : [C] setting up client
+I, [2010-09-15T02:00:28.341117 #33517] INFO -- : [C] calling client.find
+I, [2010-09-15T02:04:44.699895 #33624] INFO -- : [C] setting up client
+I, [2010-09-15T02:04:44.700066 #33624] INFO -- : [C] calling client.find
+I, [2010-09-15T02:04:56.834686 #33634] INFO -- : [C] setting up client
+I, [2010-09-15T02:04:56.834856 #33634] INFO -- : [C] calling client.find
+I, [2010-09-15T02:05:28.554975 #33658] INFO -- : [C] setting up client
+I, [2010-09-15T02:05:28.555144 #33658] INFO -- : [C] calling client.find
+I, [2010-09-15T02:05:46.003806 #33666] INFO -- : [C] setting up client
+I, [2010-09-15T02:05:46.003976 #33666] INFO -- : [C] calling client.find
+I, [2010-09-15T02:07:12.133004 #33722] INFO -- : [C] setting up client
+I, [2010-09-15T02:07:12.133172 #33722] INFO -- : [C] calling client.find
+I, [2010-09-15T02:07:12.137032 #33722] INFO -- : after client find
+I, [2010-09-15T02:07:34.037875 #33746] INFO -- : [S] Setting up server
+I, [2010-09-15T02:07:39.006461 #33748] INFO -- : [C] setting up client
+I, [2010-09-15T02:07:39.006630 #33748] INFO -- : [C] calling client.find
+I, [2010-09-15T02:07:39.011681 #33748] INFO -- : after client find
+I, [2010-09-15T02:08:36.256274 #33772] INFO -- : [C] setting up client
+I, [2010-09-15T02:08:36.256439 #33772] INFO -- : [C] calling client.find
+I, [2010-09-15T02:08:36.260529 #33772] INFO -- : after client find
+I, [2010-09-15T02:09:05.785735 #33789] INFO -- : [C] setting up client
+I, [2010-09-15T02:09:05.785941 #33789] INFO -- : [C] calling client.find
+I, [2010-09-15T02:09:05.789956 #33789] INFO -- : after client find
+I, [2010-09-15T02:09:46.930675 #33820] INFO -- : [S] Setting up server
+I, [2010-09-15T02:09:51.959646 #33821] INFO -- : [C] setting up client
+I, [2010-09-15T02:09:51.959813 #33821] INFO -- : [C] calling client.find
+I, [2010-09-15T02:09:51.965205 #33821] INFO -- : after client find
+I, [2010-09-15T02:10:50.832310 #33859] INFO -- : [S] Setting up server
+I, [2010-09-15T02:12:21.285145 #33897] INFO -- : [S] Setting up server
+I, [2010-09-15T02:12:26.512789 #33898] INFO -- : [C] setting up client
+I, [2010-09-15T02:12:26.512958 #33898] INFO -- : [C] calling client.find
+I, [2010-09-15T02:12:26.517072 #33898] INFO -- : after client find
+I, [2010-09-15T02:12:56.529455 #33938] INFO -- : [S] Setting up server
+I, [2010-09-15T02:13:09.150593 #33947] INFO -- : [S] Setting up server
+I, [2010-09-15T02:13:38.660986 #33957] INFO -- : [S] Setting up server
+I, [2010-09-15T02:14:19.078547 #33987] INFO -- : [S] Setting up server
+I, [2010-09-15T02:14:26.455010 #33994] INFO -- : [C] setting up client
+I, [2010-09-15T02:14:26.455180 #33994] INFO -- : [C] calling client.find
+I, [2010-09-15T02:14:26.459360 #33994] INFO -- : after client find
+I, [2010-09-15T02:15:25.303351 #34029] INFO -- : [C] setting up client
+I, [2010-09-15T02:15:25.303525 #34029] INFO -- : [C] calling client.find
+I, [2010-09-15T02:15:25.307922 #34029] INFO -- : after client find
+I, [2010-09-15T02:17:56.924988 #34090] INFO -- : [C] setting up client
+I, [2010-09-15T02:17:56.925162 #34090] INFO -- : [C] calling client.find
+I, [2010-09-15T02:17:56.929577 #34090] INFO -- : after client find
View
@@ -1,10 +1,10 @@
require './logger'
+require 'eventmachine'
require 'protobuf/rpc/server'
$logger.info '[S] Setting up server'
-Protobuf::Rpc::Server.new Host: 'localhost', Port: 9939, Logger: $logger
-loop do
- p '.'
- sleep 10
+EM.run do
+ EM.add_periodic_timer(10) { puts '.' }
+ EM.start_server '127.0.0.1', 9939, Protobuf::Rpc::Server
end
View
@@ -4,7 +4,7 @@
require './logger'
$logger.info '[C] setting up client'
-client = Protobuf::Rpc::Client.new Proto::UserService, 'localhost', 9938
+# client = Protobuf::Rpc::Client.new Proto::UserService, 'localhost', 9938
request = Proto::UserFindRequest.new.tap do |req|
req.guids << 'USER_GUID_1'
@@ -15,14 +15,20 @@
end
$logger.info '[C] calling client.find'
-client.find request, Proto::UserList do |controller, response|
- if controller.failed?
- $logger.error 'Got client controller failure'
- $logger.error controller.error_message
- else
- $logger.info 'Got client OK response'
- response.users.each do |user|
- $logger.info 'user.guid = %s' % user.guid
- end
- end
-end
+begin
+ Proto::UserService.client.find request do |client, response|
+ if controller.failed?
+ $logger.error 'Got client controller failure'
+ $logger.error controller.error_message
+ else
+ $logger.info 'Got client OK response'
+ response.users.each do |user|
+ $logger.info 'user.guid = %s' % user.guid
+ end
+ end
+ end
+rescue
+ $logger.error $!.message
+ $logger.error $!.backtrace.join("\n")
+end
+$logger.info 'after client find'
View
@@ -4,6 +4,7 @@
module Proto
class UserService
+ located_at 'localhost:9939'
# request -> Proto::UserFindRequest
# response -> Proto::UserList

0 comments on commit 899d605

Please sign in to comment.