File tree Expand file tree Collapse file tree 4 files changed +87
-6
lines changed
Expand file tree Collapse file tree 4 files changed +87
-6
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
2-
32import logging
43import os
54from pathlib import Path
65from typing import Dict
6+ import asyncio
77
8+ async def setup_webserver () -> None :
9+ """Setup web server configuration."""
10+ # Placeholder for web server setup logic
11+ from src .modules .api import server
12+ await server ()
813
9- def main () -> None :
14+ async def setup_transporter () -> None :
15+ """Setup transporter configuration."""
16+ # Placeholder for transporter setup logic
17+ # import src.modules.
18+ import src .modules .transporter
19+
20+ async def main () -> None :
1021 """Main application entry point."""
1122 try :
1223 print ("Start app..." )
13- import src .modules .api
24+ # import src.modules.transporter
25+ task1 = asyncio .create_task (setup_webserver ())
26+ task2 = asyncio .create_task (setup_transporter ())
27+ await asyncio .gather (task1 , task2 )
28+ print ("App started successfully." )
29+
30+
1431
1532 except Exception as e :
1633 logging .error (f"Application failed to start: { e } " , exc_info = True )
1734 raise
1835
1936
2037if __name__ == "__main__" :
21- main ()
38+ asyncio . run ( main () )
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ dependencies = [
88 " fastapi[standard]>=0.115.8" ,
99 " ipykernel>=6.29.5" ,
1010 " numpy>=2.2.3" ,
11+ " pika>=1.3.2" ,
1112 " pytest>=8.3.4" ,
13+ " rabbitmq>=0.2.0" ,
14+ " uvicorn>=0.34.0" ,
1215]
1316
1417[tool .black ]
Original file line number Diff line number Diff line change 1+ { pkgs ? import <nixpkgs> { } } :
2+
3+ let
4+ # Common environment variables
5+ envVars = {
6+ NODE_ENV = "development" ;
7+ } ;
8+
9+ in pkgs . mkShell {
10+ buildInputs = with pkgs ; [
11+ docker
12+ docker-compose
13+ nodejs_18
14+ nodePackages . ts-node
15+ ] ;
16+
17+ shellHook = ''
18+ echo "Sync packages"
19+ uv sync
20+
21+ # Activate venv
22+ if [ -d ".venv" ]; then
23+ source .venv/bin/activate
24+ else
25+ echo "Virtual environment not found, creating one..."
26+ fi
27+
28+ alias dev='python3 main.py'
29+ alias python='python3'
30+
31+ which python3
32+
33+ '' ;
34+ }
You can’t perform that action at this time.
0 commit comments