dddp/main.py
def start(self):
        """Run PostgresGreenlet and web/debug servers."""
        self.logger.debug('PostgresGreenlet start')
        self._stop_event.clear()
        self.print('=> Discovering DDP endpoints...')
        if self.verbosity > 1:
            for api_path in sorted(self.api.api_path_map()):
                print('    %s' % api_path)

        # start greenlets
        self.pgworker.start()
        self.print('=> Started PostgresGreenlet.')
        for server in self.servers:
            thread = gevent.spawn(server.serve_forever)
            gevent.sleep()  # yield to thread in case it can't start
            self.threads.append(thread)
            if thread.dead:
                # thread died, stop everything and re-raise the exception.
                self.stop()
                thread.get()
            if isinstance(server, geventwebsocket.WebSocketServer):
                self.print(
                    '=> App running at: %s://%s:%d/' % (
                        'https' if server.ssl_enabled else 'http',
                        server.server_host,
                        server.server_port,
                    ),
                )
            elif isinstance(server, gevent.backdoor.BackdoorServer):
                self.print(
                    '=> Debug service running at: telnet://%s:%d/' % (
                        server.server_host,
                        server.server_port,
                    ),
                )
        self.print('=> Started your app (%s).' % self.wsgi_name)
def start(self):
        """Run PostgresGreenlet and web/debug servers."""
        self.logger.debug('PostgresGreenlet start')
        self._stop_event.clear()
        self.print('=> Discovering DDP endpoints...')
        if self.verbosity > 1:
            for api_path in sorted(self.api.api_path_map()):
                print('    %s' % api_path)

        # start greenlets
        self.pgworker.start()
        self.print('=> Started PostgresGreenlet.')
        for server in self.servers:
            thread = gevent.spawn(server.serve_forever)
            gevent.sleep()  # yield to thread in case it can't start
            self.threads.append(thread)
            if thread.dead:
                # thread died, stop everything and re-raise the exception.
                self.stop()
                thread.get()
            if isinstance(server, geventwebsocket.WebSocketServer):
                self.print(
                    '=> App running at: %s://%s:%d/' % (
                        'https' if server.ssl_enabled else 'http',
                        server.server_host,
                        server.server_port,
                    ),
                )
            elif isinstance(server, gevent.backdoor.BackdoorServer):
                self.print(
                    '=> Debug service running at: telnet://%s:%d/' % (
                        server.server_host,
                        server.server_port,
                    ),
                )
        self.print('=> Started your app (%s).' % self.wsgi_name)
def start ( self ) : self . logger . debug ( 'PostgresGreenlet start' ) self . _stop_event . clear ( ) self . print ( '=> Discovering DDP endpoints...' ) if self . verbosity > 1 : for api_path in sorted ( self . api . api_path_map ( ) ) : print ( '    %s' % api_path ) # start greenlets self . pgworker . start ( ) self . print ( '=> Started PostgresGreenlet.' ) for server in self . servers : thread = gevent . spawn ( server . serve_forever ) gevent . sleep ( ) # yield to thread in case it can't start self . threads . append ( thread ) if thread . dead : # thread died, stop everything and re-raise the exception. self . stop ( ) thread . get ( ) if isinstance ( server , geventwebsocket . WebSocketServer ) : self . print ( '=> App running at: %s://%s:%d/' % ( 'https' if server . ssl_enabled else 'http' , server . server_host , server . server_port , ) , ) elif isinstance ( server , gevent . backdoor . BackdoorServer ) : self . print ( '=> Debug service running at: telnet://%s:%d/' % ( server . server_host , server . server_port , ) , ) self . print ( '=> Started your app (%s).' % self . wsgi_name )
Run PostgresGreenlet and web/debug servers.
Run PostgresGreenlet and web / debug servers .