pub fn start_listening<H>(self, addr: &SocketAddr, handler: H)
        where H: Handler
    {
        let https_server = Server::new(Http::new(), Arc::new(self.config));
        let tcp_server = TcpServer::new(https_server, addr.clone());
        let (tx, rx) = futures_mpsc::channel(0);
        let handler = Arc::new(handler);

        let _ = thread::spawn(move || {
            let mut core = Core::new().expect("event loop creation");
            let handle = core.handle();
            let https = HttpsConnector::new(4, &handle);
            let client = Client::configure().connector(https).build(&handle);
            info!("Created listener queue for requests!");

            let listen_messages = rx.for_each(|call: EventLoopRequest<()>| {
                call(&client).map_err(|e| {
                    info!("Error resolving closure: {}", e);
                })
            });

            core.run(listen_messages).expect("running event loop");
        });

        tcp_server.serve(move || {
            Ok(BotHandler::new(handler.clone(), tx.clone()))
        });
    }
/// Start listening for incoming HTTPS requests (indefinitely), and forward
/// events to the associated handler.
///
/// This has two threads - one for serving HTTPS requests from
/// the Wire server, and another for running an event loop
/// which makes HTTPS requests to the Wire server.
Start listening for incoming HTTPS requests (indefinitely), and forward
events to the associated handler.

This has two threads - one for serving HTTPS requests from
the Wire server, and another for running an event loop
which makes HTTPS requests to the Wire server.
Start listening for incoming HTTPS requests ( indefinitely ) and forward events to the associated handler . This has two threads - one for serving HTTPS requests from the Wire server and another for running an event loop which makes HTTPS requests to the Wire server .
pub fn start_listening<H>(self, addr: &SocketAddr, handler: H)
        where H: Handler
    {
        let https_server = Server::new(Http::new(), Arc::new(self.config));
        let tcp_server = TcpServer::new(https_server, addr.clone());
        let (tx, rx) = futures_mpsc::channel(0);
        let handler = Arc::new(handler);
        let _ = thread::spawn(move || {
            let mut core = Core::new().expect("event loop creation");
            let handle = core.handle();
            let https = HttpsConnector::new(4, &handle);
            let client = Client::configure().connector(https).build(&handle);
            info!("Created listener queue for requests!");
            let listen_messages = rx.for_each(|call: EventLoopRequest<()>| {
                call(&client).map_err(|e| {
                    info!("Error resolving closure: {}", e);
                })
            });
            core.run(listen_messages).expect("running event loop");
        });
        tcp_server.serve(move || {
            Ok(BotHandler::new(handler.clone(), tx.clone()))
        });
    }
pub fn start_listening < H > ( self , addr : & SocketAddr , handler : H ) where H : Handler { let https_server = Server :: new ( Http :: new ( ) , Arc :: new ( self . config ) ) ; let tcp_server = TcpServer :: new ( https_server , addr . clone ( ) ) ; let ( tx , rx ) = futures_mpsc :: channel ( 0 ) ; let handler = Arc :: new ( handler ) ; let _ = thread :: spawn ( move | | { let mut core = Core :: new ( ) . expect ( " " ) ; let handle = core . handle ( ) ; let https = HttpsConnector :: new ( 4 , & handle ) ; let client = Client :: configure ( ) . connector ( https ) . build ( & handle ) ; info ! ( " " ) ; let listen_messages = rx . for_each ( | call : EventLoopRequest < ( ) > | { call ( & client ) . map_err ( | e | { info ! ( " " e ) ; } ) } ) ; core . run ( listen_messages ) . expect ( " " ) ; } ) ; tcp_server . serve ( move | | { Ok ( BotHandler :: new ( handler . clone ( ) , tx . clone ( ) ) ) } ) ; }
Start listening for incoming HTTPS requests (indefinitely), and forward
events to the associated handler.
Start listening for incoming HTTPS requests ( indefinitely ) and forward events to the associated handler .
self
addr
&SocketAddr
handler
H