def setup_server(module_labels, module_params): utils.define_maker( make_server, { 'create_engine': module_labels.database.create_engine, 'publisher': module_labels.publisher.publisher, 'return': module_labels.server.server, }, ) utils.define_maker( make_publisher, { 'return': module_labels.publisher.publisher, }, ) g1.messaging.parts.servers.setup_server( module_labels.server, module_params.server, ) g1.messaging.parts.publishers.setup_publisher( module_labels.publisher, module_params.publisher, ) g1.databases.parts.setup_create_engine( module_labels.database, module_params.database, )
def setup_console(module_labels, module_params): utils.depend_parameter_for(module_labels.params, module_params) utils.define_maker( make_console, { 'params': module_labels.params, }, )
def setup_publisher(module_labels, module_params): utils.depend_parameter_for(module_labels.publisher_params, module_params) utils.define_maker( make_agent, { 'publisher': module_labels.publisher, 'params': module_labels.publisher_params, }, )
def setup_executor(module_labels, module_params): utils.depend_parameter_for(module_labels.executor_params, module_params) utils.define_maker( make_executor, { 'params': module_labels.executor_params, 'return': module_labels.executor, }, )
def setup_client(module_labels, module_params): utils.depend_parameter_for(module_labels.client_params, module_params) utils.define_maker( configure_client, { 'client': module_labels.client, 'params': module_labels.client_params, }, )
def setup_stub(module_labels, module_params): utils.depend_parameter_for(module_labels.stub_params, module_params) utils.define_maker( make_stub, { 'params': module_labels.stub_params, 'return': module_labels.stub, }, )
def setup_server(module_labels, module_params): utils.depend_parameter_for(module_labels.server_params, module_params) utils.define_maker( make_agent, { 'server': module_labels.server, 'params': module_labels.server_params, }, )
def setup_create_engine(module_labels, module_params): utils.depend_parameter_for(module_labels.create_engine_params, module_params) utils.define_maker( make_create_engine, { 'params': module_labels.create_engine_params, 'return': module_labels.create_engine, }, )
def setup_session(module_labels, module_params): utils.depend_parameter_for(module_labels.session_params, module_params) utils.define_maker( make_session, { 'params': module_labels.session_params, 'executor': module_labels.executor, 'return': module_labels.session, }, )
def setup_server(module_labels, module_params): g1.networks.servers.parts.setup_server(module_labels.server, module_params) utils.define_maker( # Although this is called a server, from the perspective of # g1.networks.servers.SocketServer, this is a handler. servers.HttpServer, { 'server_socket': module_labels.server.socket, 'application': module_labels.application, 'return': module_labels.server.handler, }, )
def setup_server(module_labels, module_params): g1.http.servers.parts.setup_server( module_labels.server, module_params ) utils.define_maker( wsgi_apps.Application, { 'handler': module_labels.handler, 'return': module_labels.server.application, }, ) utils.define_maker( make_agent, { 'application': module_labels.server.application, }, )
def setup_subscriber(module_labels, module_params): utils.define_maker( make_queue, { 'return': module_labels.queue, }, ) utils.define_maker( subscribers.make_subscriber, { 'queue': module_labels.queue, 'return': module_labels.subscriber.subscriber, }, ) g1.messaging.parts.subscribers.setup_subscriber( module_labels.subscriber, module_params, )
def setup_server(module_labels, module_params): utils.depend_parameter_for(module_labels.params, module_params) # Server. utils.define_maker( make_socket_server, { 'socket': module_labels.socket, 'handler': module_labels.handler, 'params': module_labels.params, 'return': module_labels.server, }, ) utils.define_maker( make_agent, { 'server': module_labels.server, }, ) # Server socket. utils.define_maker( make_server_socket, { 'params': module_labels.params, 'ssl_context': module_labels.ssl_context, 'return': module_labels.socket, }, ) # SSL context. for name in ( 'certificate', 'private_key', 'client_authentication', 'protocols', ): utils.depend_parameter_for(module_labels[name], module_params[name]) utils.define_maker( sockets.make_ssl_context, { 'certificate': module_labels.certificate, 'private_key': module_labels.private_key, 'client_authentication': module_labels.client_authentication, 'protocols': module_labels.protocols, 'return': module_labels.ssl_context, }, )
def define_monitor(): utils.depend_parameter_for(PARAMS_LABEL, PARAMS) utils.define_maker(make_monitor)
'executor_params', 'executor', ) utils.depend_parameter_for( LABELS.executor_params, parameters.define( __name__, g1.threads.parts.make_executor_params(), ), ) utils.define_maker( g1.threads.parts.make_executor, { 'params': LABELS.executor_params, 'return': LABELS.executor, }, ) def square(x): duration = random.uniform(0, 4) time.sleep(duration) answer = x * x print('computing: %d^2 is %d' % (x, answer)) return answer, duration def main(executor: LABELS.executor): start = time.perf_counter()
def setup_client(module_labels, module_params): utils.define_maker(clients.make_client, {'return': module_labels.client}) g1.messaging.parts.clients.setup_client(module_labels, module_params)