require 'ldap/server' require 'rbmk/operation' module RBMK class Worker def self.hire client, upstream; new(client, upstream).serve end def initialize client, upstream upstream.mktemp @socket = client @conn = LDAP::Server::Connection.new @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 end end end