Where to kick the transcode worker
Closed this issue · 5 comments
shin1ohno commented
As of #6 , we have 2 features:
- User can upload movie file to S3
- Worker can transcode the movie file into jani formatted strips
But I don't decide where to kick the transcoder worker.
- Use callbacks of MovieUploader: kick the worker in MovieUploader's callback like after cache
- Use versions of MovieUploader: Movie has jani-formatted strips as a version of it.
- Use callbacks of Movie: Using ActiveRecord's callbacks, Movie model kicks the worker.
I think 2 is preferable.
func09 commented
Carrierwave のバージョンは、ファイルのサイズ違いを作ってモデルからアクセスしやすくするイメージなので
今回はコールバックの方かなと思いました。
shin1ohno commented
確かに、バージョン機能で変換しても、バージョンとして呼び出されるものがなにかよくわからないですね…… そうすると1か3か。1のafter cache
が順当なのかな。
shin1ohno commented
after cache
は無限ループするなw 。ていうか、この時点ではMovieインスタンスが出来てないからだめか。むずい……
l15n commented
ActiveRecordのコールバックは、なんとなく好きじゃないので、普通にコントローラーでキックすることにした
時代は、ARコールバークじゃなくなってきてるんで、正しいと思う