Skip to content

Instantly share code, notes, and snippets.

@merqlove
Created October 30, 2016 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merqlove/6fa074c7bfa993121d018aa414670450 to your computer and use it in GitHub Desktop.
Save merqlove/6fa074c7bfa993121d018aa414670450 to your computer and use it in GitHub Desktop.
Concurrent
.future(thread_pool) do
update_spin(spin, title: "Resizing image #{image.id}")
service.run(image)
end
.then do |r|
update_spin(spin, title: "Resized image #{r.id}")
r
end
.rescue { |_| nil }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment