From 0f9aa8c6d3303bdb51d8ae017a94aaa747c8155b Mon Sep 17 00:00:00 2001 From: depetrol Date: Thu, 10 Oct 2024 12:10:02 -0700 Subject: [PATCH] unfederated execution for +1 examples --- .gitignore | 1 + examples/Python/src/WebServer/minimal.lf | 4 ++-- examples/Python/src/WebServer/minimal_with_lib.lf | 4 ++-- examples/Python/src/lib/WebServer.lf | 10 +++++----- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 4d594143..a42b10a6 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ C/include Cpp/**/include Cpp/**/share Cpp/**/lib +examples/Python/include # Created by https://www.toptal.com/developers/gitignore/api/intellij,gradle,eclipse,maven,visualstudiocode # Edit at https://www.toptal.com/developers/gitignore?templates=intellij,gradle,eclipse,maven,visualstudiocode diff --git a/examples/Python/src/WebServer/minimal.lf b/examples/Python/src/WebServer/minimal.lf index 2b727d74..9b838e3c 100644 --- a/examples/Python/src/WebServer/minimal.lf +++ b/examples/Python/src/WebServer/minimal.lf @@ -1,5 +1,5 @@ target Python { - coordination: decentralized + keepalive: true } preamble {= @@ -53,6 +53,6 @@ reactor WebServer(bank_index=0, STA=0) { =} } -federated reactor { +main reactor { server = new WebServer() } diff --git a/examples/Python/src/WebServer/minimal_with_lib.lf b/examples/Python/src/WebServer/minimal_with_lib.lf index d8e281f2..f5da0f75 100644 --- a/examples/Python/src/WebServer/minimal_with_lib.lf +++ b/examples/Python/src/WebServer/minimal_with_lib.lf @@ -1,5 +1,5 @@ target Python { - coordination: decentralized + keepalive: true } import WebServer from "../lib/WebServer.lf" @@ -17,7 +17,7 @@ reactor Handler { =} } -federated reactor { +main reactor { server = new WebServer(path="/addone") handler = new Handler() server.request -> handler.request diff --git a/examples/Python/src/lib/WebServer.lf b/examples/Python/src/lib/WebServer.lf index 5a8df7a4..79e962be 100644 --- a/examples/Python/src/lib/WebServer.lf +++ b/examples/Python/src/lib/WebServer.lf @@ -14,13 +14,13 @@ target Python { * * The `path` parameter is the path at which the server listens for HTTP POST requests. * - * The `request` output is a list of two values: the request ID and the request data. If the - * request header indicates that the body is a JSON object, the request data is parsed into a python + * The `request` output is a list of two values: the request ID and the request data. If the request + * header indicates that the body is a JSON object, the request data is parsed into a python * dictionary. Otherwise, the request body is forwarded as-is. * - * The `response` input is a list of two values: the request ID and the response data. Request ID - * is required to respond to the correct request. Use a physical connection to connect the - * `response` input to avoid STP violations. + * The `response` input is a list of two values: the request ID and the response data. Request ID is + * required to respond to the correct request. Use a physical connection to connect the `response` + * input to avoid STP violations. * * To use this reactor, you must install the fastapi and uvicorn libraries for Python. You can do * this with `pip install fastapi uvicorn`.