MCPcopy Create free account
hub / github.com/apify/crawlee-python / run

Method run

tests/unit/server.py:532–539  ·  view source on GitHub ↗

Run the server.

(self, sockets: list[socket] | None = None)

Source from the content-addressed store, hash-verified

530 await self.startup()
531
532 def run(self, sockets: list[socket] | None = None) -> None:
533 """Run the server."""
534 # Set the event loop policy in thread with server for Windows and Python 3.12+.
535 # This is necessary because there are problems with closing connections when using `ProactorEventLoop`.
536 if sys.version_info >= (3, 12) and sys.platform == 'win32':
537 return asyncio.run(self.serve(sockets=sockets), loop_factory=asyncio.SelectorEventLoop)
538 super().run(sockets=sockets)
539 return None
540
541
542def serve_in_thread(server: TestServer) -> Iterator[TestServer]:

Calls 1

serveMethod · 0.95