Skip to content

Commit

Permalink
Documentation corrected and return changed by yield when stopIteration
Browse files Browse the repository at this point in the history
  • Loading branch information
javierganan99 committed Oct 15, 2023
1 parent 7e1102d commit 784471c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions app/routes/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@


@simulation_blueprint.route("/simulation")
def start_simulation(HOST="localhost", PORT=999):
def start_simulation():
"""
TODO: Provide a more insightful description!
Start a simulation of the vehicle routing problem. This includes creating a server socket thread,
creating client socket processes, and emitting images from the vehicles to the client side.
Parameters:
HOST (str, optional): Host of the server. Default is "localhost".
PORT (int, optional): Port number the server listens to. Default is 999.
Start a simulation of the vehicle routing problem.
"""

def stream(simulation, simulation_path):
Expand All @@ -26,7 +20,7 @@ def stream(simulation, simulation_path):
string_data = f"data: {json.dumps(coords)}\n\n"
yield string_data
except StopIteration:
return "data: None\n\n"
yield "data: None\n\n"

current_app.simulation = True
# Define simulation path
Expand Down

0 comments on commit 784471c

Please sign in to comment.