This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule DummyExternalResource do | |
defstruct range: nil, | |
done: false, | |
something_important: nil | |
def stream(external_resource) do | |
Stream.resource( | |
fn -> external_resource end, | |
fn (resource=%__MODULE__{done: true}) -> {:halt, resource} | |
(resource) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
video_ids.each do |video_id| | |
p "." | |
yt_video = Yt::Video.new(id: video_id) | |
begin | |
yt_video.channel_id #trigger request | |
rescue => e | |
next | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ResqueToSidekiqMigration | |
def initialize(redis) | |
@redis = redis | |
end | |
def migrate! | |
migrate_queues | |
clear_resque_keys! | |
end |