{"action":"created","issue":{"url":"https://api.github.com/repos/aces/cbrain/issues/620","repository_url":"https://api.github.com/repos/aces/cbrain","labels_url":"https://api.github.com/repos/aces/cbrain/issues/620/labels{/name}","comments_url":"https://api.github.com/repos/aces/cbrain/issues/620/comments","events_url":"https://api.github.com/repos/aces/cbrain/issues/620/events","html_url":"https://github.com/aces/cbrain/issues/620","id":222800286,"number":620,"title":"Added 'backgrounder' console command.","user":{"login":"prioux","id":777588,"avatar_url":"https://avatars2.githubusercontent.com/u/777588?v=3","gravatar_id":"","url":"https://api.github.com/users/prioux","html_url":"https://github.com/prioux","followers_url":"https://api.github.com/users/prioux/followers","following_url":"https://api.github.com/users/prioux/following{/other_user}","gists_url":"https://api.github.com/users/prioux/gists{/gist_id}","starred_url":"https://api.github.com/users/prioux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prioux/subscriptions","organizations_url":"https://api.github.com/users/prioux/orgs","repos_url":"https://api.github.com/users/prioux/repos","events_url":"https://api.github.com/users/prioux/events{/privacy}","received_events_url":"https://api.github.com/users/prioux/received_events","type":"User","site_admin":false},"labels":[{"id":191530048,"url":"https://api.github.com/repos/aces/cbrain/labels/Enhancement","name":"Enhancement","color":"84b6eb","default":false},{"id":310417590,"url":"https://api.github.com/repos/aces/cbrain/labels/Priority:%20Normal","name":"Priority: Normal","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/aces/cbrain/milestones/4","html_url":"https://github.com/aces/cbrain/milestone/4","labels_url":"https://api.github.com/repos/aces/cbrain/milestones/4/labels","id":1067097,"number":4,"title":"5.0.0","description":null,"creator":{"login":"natacha-beck","id":777590,"avatar_url":"https://avatars2.githubusercontent.com/u/777590?v=3","gravatar_id":"","url":"https://api.github.com/users/natacha-beck","html_url":"https://github.com/natacha-beck","followers_url":"https://api.github.com/users/natacha-beck/followers","following_url":"https://api.github.com/users/natacha-beck/following{/other_user}","gists_url":"https://api.github.com/users/natacha-beck/gists{/gist_id}","starred_url":"https://api.github.com/users/natacha-beck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natacha-beck/subscriptions","organizations_url":"https://api.github.com/users/natacha-beck/orgs","repos_url":"https://api.github.com/users/natacha-beck/repos","events_url":"https://api.github.com/users/natacha-beck/events{/privacy}","received_events_url":"https://api.github.com/users/natacha-beck/received_events","type":"User","site_admin":false},"open_issues":41,"closed_issues":1,"state":"open","created_at":"2015-04-14T15:23:31Z","updated_at":"2017-04-19T16:44:50Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-04-19T16:44:50Z","updated_at":"2017-04-19T16:50:29Z","closed_at":null,"body":"It would be useful to have a console utility command to launch a background process that iterates over an array and runs an arbitrary block of code on each element.\r\n\r\nFor example, if a LocalDataProvider is on a remote site where a Bourreau is also installed, and there are hundreds of files I would like to archive there, I could connect to the Bourreau's console and run the archiving methods in the backgrounder:\r\n\r\n```ruby\r\nbourreau_console> files = FileCollection.where(:data_provider_id => 23).all # assume DP 23 is local to Bourreau\r\nbourreau_console> backgrounder(files) { |f| f.provider_archive }\r\n```\r\n\r\nThe advantage here is that unlike a archiving launched from the portal, there is no costly synchronization done to and from the portal.\r\n\r\nThe backgrounder method would report about the PID of the subprocess, and allow a clean stop IN BETWEEN processing by receiving the `SIGHUP` signal.\r\nAlso, maybe it could create a report based on the returned value for each iteration of the block and save this in a new Message object."},"comment":{"url":"https://api.github.com/repos/aces/cbrain/issues/comments/295341423","html_url":"https://github.com/aces/cbrain/issues/620#issuecomment-295341423","issue_url":"https://api.github.com/repos/aces/cbrain/issues/620","id":295341423,"user":{"login":"prioux","id":777588,"avatar_url":"https://avatars2.githubusercontent.com/u/777588?v=3","gravatar_id":"","url":"https://api.github.com/users/prioux","html_url":"https://github.com/prioux","followers_url":"https://api.github.com/users/prioux/followers","following_url":"https://api.github.com/users/prioux/following{/other_user}","gists_url":"https://api.github.com/users/prioux/gists{/gist_id}","starred_url":"https://api.github.com/users/prioux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prioux/subscriptions","organizations_url":"https://api.github.com/users/prioux/orgs","repos_url":"https://api.github.com/users/prioux/repos","events_url":"https://api.github.com/users/prioux/events{/privacy}","received_events_url":"https://api.github.com/users/prioux/received_events","type":"User","site_admin":false},"created_at":"2017-04-19T16:50:29Z","updated_at":"2017-04-19T16:50:29Z","body":"Options too:\r\n\r\n```ruby\r\nbackgrounder(array, :continue_on_exception => true) { |x| blahblah }\r\n```"}}
{"actor":{"display_login":"prioux"}}