aws-samples / aws-samples/amazon-textract-textractor
Caller: allow early return when job incomplete
- Dominant language
- Jupyter Notebook
- Stars
- 493
- Forks
- 163
- PR merge metrics
- No merged PRs in 30d
Description
I'm using Textract in a web application.
I'm enqueuing jobs using `extractor.start_document_analysis` and storing the returned job ID in a database.
Later, I call `extractor.get_result(job_id)` to get the response for processing.
At the moemnt, `get_result` calls `t_call.get_full_json` and that kicks off a while loop that blocks until the job is in some way finished (e.g `job_status != "IN_PROGRESS"`).
I'd really like a `blocking=False` flag that will simply retun the job status if it's `IN_PROGRESS`. This is beacuse I'm already polling for completeness in my application and I don't want to block my polling workers in this loop.
Of course, I can use the boto3 API to check the status directly before calling `get_result`, but it would be nice to have this as a feature built in.
I'm happy to work on a PR if this seems like a useful feature.
Contributor guide
Assessment
This issue has not been assessed yet.