lib/rbmk/worker.rb in rbmk-0.1.0.c vs lib/rbmk/worker.rb in rbmk-0.1.0.d
- old
+ new
@@ -1,26 +1,27 @@
require 'ldap/server'
require 'rbmk/operation'
+require 'rbmk/peer'
module RBMK
class Worker
- def self.hire client, upstream; new(client, upstream).serve end
+ def self.hire peer, upstream; new(peer, upstream).serve end
- def initialize client, upstream
+ def initialize peer, upstream
upstream.mktemp
- @socket = client
- @conn = LDAP::Server::Connection.new @socket,
+ @peer = peer
+ @conn = LDAP::Server::Connection.new @peer.socket,
server: upstream,
logger: $log,
operation_class: RBMK::Operation,
schema: upstream.schema,
namingContexts: upstream.root_dse['namingContexts']
end
def serve
@conn.handle_requests
ensure
- @socket.close
+ @peer.close
end
end
end