-
This commit is contained in:
16
faas/test_functions/streaming_logs.js
Normal file
16
faas/test_functions/streaming_logs.js
Normal file
@ -0,0 +1,16 @@
|
||||
module.exports.handler = async (input, context) => {
|
||||
console.log("Starting function execution");
|
||||
|
||||
for (let i = 1; i <= 10; i++) {
|
||||
console.log(`Processing step ${i}`);
|
||||
// Wait 1 second between log outputs
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
}
|
||||
|
||||
console.log("Function execution completed");
|
||||
|
||||
return {
|
||||
message: "Function executed successfully",
|
||||
steps: 10
|
||||
};
|
||||
};
|
||||
16
faas/test_functions/streaming_logs.py
Normal file
16
faas/test_functions/streaming_logs.py
Normal file
@ -0,0 +1,16 @@
|
||||
import time
|
||||
|
||||
def handler(input, context):
|
||||
print("Starting function execution")
|
||||
|
||||
for i in range(1, 11):
|
||||
print(f"Processing step {i}")
|
||||
# Wait 1 second between log outputs
|
||||
time.sleep(1)
|
||||
|
||||
print("Function execution completed")
|
||||
|
||||
return {
|
||||
"message": "Function executed successfully",
|
||||
"steps": 10
|
||||
}
|
||||
Reference in New Issue
Block a user