{"action":"created","issue":{"url":"https://api.github.com/repos/rubytaiwan/AMA/issues/72","labels_url":"https://api.github.com/repos/rubytaiwan/AMA/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/rubytaiwan/AMA/issues/72/comments","events_url":"https://api.github.com/repos/rubytaiwan/AMA/issues/72/events","html_url":"https://github.com/rubytaiwan/AMA/issues/72","id":114004593,"number":72,"title":"獨立於Rails外的程式，如何丟任務給Rails sidekiq執行?","user":{"login":"jcsky","id":11516354,"avatar_url":"https://avatars.githubusercontent.com/u/11516354?v=3","gravatar_id":"","url":"https://api.github.com/users/jcsky","html_url":"https://github.com/jcsky","followers_url":"https://api.github.com/users/jcsky/followers","following_url":"https://api.github.com/users/jcsky/following{/other_user}","gists_url":"https://api.github.com/users/jcsky/gists{/gist_id}","starred_url":"https://api.github.com/users/jcsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcsky/subscriptions","organizations_url":"https://api.github.com/users/jcsky/orgs","repos_url":"https://api.github.com/users/jcsky/repos","events_url":"https://api.github.com/users/jcsky/events{/privacy}","received_events_url":"https://api.github.com/users/jcsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-29T08:51:33Z","updated_at":"2015-10-30T09:31:09Z","closed_at":null,"body":"我在 Rails 外，有個獨立的 listen.rb ，用來接收 API message訊息(xml)\r\nlisten.rb 目前是收到 xml msg就直接吐出 xml file\r\n而我希望 listen.rb 在收到 message 後，能通知 Rails 去解析 xml 並更新database\r\n(更進一步希望使用 ActionCable 更新 client 的頁面)\r\n\r\n我目前的做法是在 Rails 中使用 sidekiq \r\n我在 app/jobs 寫了個 worker_job.rb 預期用來解析 xml 及更新 db\r\n在Rails/controller 中 WorkerJob.perform_later 能夠順利將任務排入Sidekiq\r\n想說在 listen.rb 中做一樣的事，把任務排入 Sidekiq 就能由 Rails worker_job.rb 去執行了\r\n\r\n可是我不曉得 listen.rb 應該怎麼丟任務給 Sidekiq ~??\r\n\r\n想請問我現在的方向對嗎?? 或是有沒有其它的方式可以達成這需求??"},"comment":{"url":"https://api.github.com/repos/rubytaiwan/AMA/issues/comments/152471398","html_url":"https://github.com/rubytaiwan/AMA/issues/72#issuecomment-152471398","issue_url":"https://api.github.com/repos/rubytaiwan/AMA/issues/72","id":152471398,"user":{"login":"jcsky","id":11516354,"avatar_url":"https://avatars.githubusercontent.com/u/11516354?v=3","gravatar_id":"","url":"https://api.github.com/users/jcsky","html_url":"https://github.com/jcsky","followers_url":"https://api.github.com/users/jcsky/followers","following_url":"https://api.github.com/users/jcsky/following{/other_user}","gists_url":"https://api.github.com/users/jcsky/gists{/gist_id}","starred_url":"https://api.github.com/users/jcsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcsky/subscriptions","organizations_url":"https://api.github.com/users/jcsky/orgs","repos_url":"https://api.github.com/users/jcsky/repos","events_url":"https://api.github.com/users/jcsky/events{/privacy}","received_events_url":"https://api.github.com/users/jcsky/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T09:31:09Z","updated_at":"2015-10-30T09:31:09Z","body":"可以了，找到最後發現是我打錯字了... stream_async:api 才對"}}