Skip to content

Commit 404f889

Browse files
authored
chore: update robyn to latest version (#9217)
* chore: update robyn to latest version * update v number
1 parent 0ffacd9 commit 404f889

File tree

7 files changed

+20
-26
lines changed

7 files changed

+20
-26
lines changed

frameworks/Python/robyn/app-const.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import multiprocessing
22
import os
33

4-
from robyn import Response, Robyn, jsonify
4+
from robyn import Response, Robyn
55
from robyn.argument_parser import Config
66

77

88
class SpecialConfig(Config):
99
def __init__(self):
1010
super().__init__()
11-
self.workers = 2
12-
self.processes = (os.cpu_count() * 2) + 1
11+
self.workers = (os.cpu_count() * 2) + 1
12+
self.processes = os.cpu_count()
1313
self.log_level = "WARN"
1414

1515

@@ -22,16 +22,12 @@ def plaintext() -> str:
2222

2323

2424
@app.get("/json", const=True)
25-
def json() -> str:
26-
return Response(
27-
status_code=200,
28-
description=jsonify({"message": "Hello, world!"}),
29-
headers={"Content-Type": "application/json"}
30-
)
31-
25+
def json() -> dict:
26+
return {
27+
"message": "Hello, world!"
28+
}
3229

3330

3431
if __name__ == "__main__":
3532
app.add_response_header("Server", "Robyn")
36-
3733
app.start(host="0.0.0.0", port=8080)

frameworks/Python/robyn/app.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import multiprocessing
22
import os
33

4-
from robyn import Response, Robyn, jsonify
4+
from robyn import Response, Robyn
55
from robyn.argument_parser import Config
66

77

88
class SpecialConfig(Config):
99
def __init__(self):
1010
super().__init__()
11-
self.workers = 2
12-
self.processes = (os.cpu_count() * 2) + 1
11+
self.workers = (os.cpu_count() * 2) + 1
12+
self.processes = os.cpu_count()
1313
self.log_level = "WARN"
1414

1515

@@ -22,13 +22,10 @@ def plaintext() -> str:
2222

2323

2424
@app.get("/json")
25-
def json() -> str:
26-
return Response(
27-
status_code=200,
28-
description=jsonify({"message": "Hello, world!"}),
29-
headers={"Content-Type": "application/json"}
30-
)
31-
25+
def json() -> dict:
26+
return {
27+
"message": "Hello, world!"
28+
}
3229

3330
if __name__ == "__main__":
3431
app.add_response_header("Server", "Roby1n")

frameworks/Python/robyn/benchmark_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@
3838
}
3939
}
4040
]
41-
}
41+
}
42+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
uvloop==0.19.0
2-
robyn==0.45.0
2+
robyn==0.60.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
uvloop==0.19.0
2-
robyn==0.45.0
2+
robyn==0.60.2

frameworks/Python/robyn/robyn-const.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ RUN pip3 install -r /robyn/requirements-const.txt
88

99
EXPOSE 8080
1010

11-
CMD ["python", "app-const.py", "--log-level", "warn"]]
11+
CMD ["robyn", "app-const.py", "--fast"]

frameworks/Python/robyn/robyn.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ RUN pip3 install -r /robyn/requirements.txt
88

99
EXPOSE 8080
1010

11-
CMD ["python", "app.py", "--log-level", "warn"]
11+
CMD ["robyn", "app.py", "--fast"]

0 commit comments

Comments
 (0)