-
Notifications
You must be signed in to change notification settings - Fork 2
Add a transfer_complete callback to storage connectors #188
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
Add a transfer_complete callback to storage connectors #188
Conversation
|
I'll be able to take a look on the weekend - watch this space. :D. Be sure to add a test when you can. |
… storage connectors
Done. I’ve added Mimic to stub |
|
@RodolfoSilva The code looks fine, I'm just wondering a little about the use-case. By adding it as a behaviour callback, we're saying this is useful for every storage connector, but the File and S3 connectors just say I could see it being useful for custom connectors, but I'm not sure why we would need it in the behaviour. For a custom connector, if its useful, then they would just implement a transfer complete within their implementation of If we do go forward with it, I think it would be better to have maybe Let me know what you think 🎅 |
|
@camatcode I like this idea, but how can we implement it? The goal of this behavior is to allow me to take some action after the file finishes uploading to the server, instead of having to constantly poll or scan for changes. |
camatcode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a look @RodolfoSilva , see if that will help your case.
Add to the storage_config a module and function with arity 3 (type, path, connector_state) that will be called with STOR and RETR completes.
storage_config: %{
# Optional: Handler for transfer completion notifications
# Default: Logs "Transfer complete: <type> <path>"
on_transfer_complete: {MyApp.TransferHandler, :handle_complete}
}Let me know what you think.
|
|
||
| @source_url "https://github.com/camatcode/ex_ftp" | ||
| @version "1.2.0" | ||
| @version "1.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saving myself a commit
This will allow to dispatch an action when a transfer file is completed. Like create an Oban job to convert the file uploaded or notify any other service when the transfer of a file is completed.