1 /** 2 * Copyright: (c) 2015-2017, Milofon Project. 3 * License: Subject to the terms of the BSD license, as written in the included LICENSE.txt file. 4 * Author: <m.galanin@milofon.org> Maksim Galanin 5 * Date: 2018-01-24 6 */ 7 8 module dango.service.transport; 9 10 public 11 { 12 import dango.service.transport.core : ServerTransport, ClientTransport; 13 } 14 15 private 16 { 17 import poodinis : ApplicationContext, DependencyContainer, newInstance; 18 import dango.system.container : registerByName; 19 20 import dango.service.transport.http : HTTPServerTransport, HTTPClientTransport; 21 import dango.service.transport.zeromq : ZeroMQServerTransport, ZeroMQClientTransport; 22 } 23 24 25 class TransportContext : ApplicationContext 26 { 27 override void registerDependencies(shared(DependencyContainer) container) 28 { 29 container.registerByName!(ServerTransport, HTTPServerTransport)("http").newInstance(); 30 container.registerByName!(ServerTransport, ZeroMQServerTransport)("zmq").newInstance(); 31 32 container.registerByName!(ClientTransport, HTTPClientTransport)("http").newInstance(); 33 container.registerByName!(ClientTransport, ZeroMQClientTransport)("zmq").newInstance(); 34 } 35 }