Skip to content

Commit

Permalink
clearer docs on background functions
Browse files Browse the repository at this point in the history
  • Loading branch information
edublancas committed Apr 4, 2024
1 parent bb3650a commit 23e1af4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/features/serverless-fns.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ def random_array(size):
# run function in the background, returns immediately with a job_id
job_id = random_array.background(10)

# get job status
# returns a dictionary with 'status' and 'traceback'
status = functions.get_job_status(job_id)

# if status == 'SUCCEEDED', you can retrieve the output
functions.get_result_from_remote_function(job_id)
# if status['status'] == 'SUCCEEDED', you can retrieve the output
result = functions.get_result_from_remote_function(job_id)

# if status == 'SUBMITTED', the function is running
# if status == 'FAILED', you can see the error message
# if status['status'] == 'SUBMITTED', the function is running
# if status['status'] == 'FAILED', you can see the error message
print(status["traceback"])
```

Expand Down

0 comments on commit 23e1af4

Please sign in to comment.