csv - Execute code when Rails is finished streaming a download -


i have streaming download in rails 4 application, downloads csv file using enumerator , wondering if there way execute code once streaming has completed, aka enumerator done?

the reason need execute code once streaming download finished because in creating csv had created temporary tables in database need delete once download done.

you have several options:

1) create , launch task sidekiq

2) declare callback: after_update or after_create after data recorded.

3) set cron job using ruby script.

4) handle download process microservice using rabbitmq.


Comments