Skip to content

Flow Options target wait until completes if a function #294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
justinmusti opened this issue May 7, 2020 · 0 comments
Open

Flow Options target wait until completes if a function #294

justinmusti opened this issue May 7, 2020 · 0 comments

Comments

@justinmusti
Copy link

When assigning configuration, the documentation states that target property can be a function.

While utilizing it as a function, wait for it to complete or return a response before starting the upload process so a proper URL is returned.

USECASE:

  1. simultaneousUploads is set to something bigger than 1, let's say 5
  2. Flow starts uploading file in 5 chunks at a time.
  3. Server is now facing a race condition because the chunks are being sent simultaneously hence database entries are created at the same time causing duplicate entries.
  4. File upload process is now corrupted.

For a healthy way of implementation to ensure the race condition is averted with proper back-end reference to the file, allow the target option to be a function and wait until it returns a response, which is a unique url for the file to be uploaded to.

Problem

Currently the Flow object does not wait to start uploading the file until after the target function returns a response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant