Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yuiseki/289054 to your computer and use it in GitHub Desktop.
Save yuiseki/289054 to your computer and use it in GitHub Desktop.
1.text 型で :data というカラムを持った Async というモデルを作る。
2.アプリケーションから非同期になにかやりたい時は {:method => 処理の名称, :args => 引数} みたいな感じのハッシュを JSON 化して Async のインスタンスを create する
3.Async の中身を見て、何かあったら :method の処理に :args の引数を渡して走らせ、終ったら対象を destroy するというメソッドをどっかに作って cron で ./script/runner 経由で回す
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment