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 CardCreator | |
include Publisher | |
def create(iteration, attributes) | |
card = iteration.cards.build(attributes) | |
card.save! | |
rescue ActiveRecord::RecordInvalid | |
notify_subscribers(:create_failed, card) | |
else | |
notify_subscribers(:created, card) |
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 CardCreator < Struct.new(:listener) | |
def create(iteration, attributes) | |
card = iteration.cards.build(attributes) | |
if card.save | |
listener.created(card) | |
else | |
listener.create_failed(card) | |
end | |
end | |
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
/* Multiget web service, written in Node | |
http://127.0.0.1:9001/?urls=http://example.com/,http://example.net/ | |
Will fetch all URLs in parallel, then return a JSON response containing | |
the fetched content from them. | |
*/ | |
var DEFAULT_TIMEOUT = 10000; |