Skip to content

Instantly share code, notes, and snippets.

@technicalpickles
Created April 22, 2011 04:34
Show Gist options
  • Save technicalpickles/936018 to your computer and use it in GitHub Desktop.
Save technicalpickles/936018 to your computer and use it in GitHub Desktop.
timeout proxy object brainstorming
@video = timeout_after 5.seconds do
RemoteVideo.find(params[:id])
end
<% unless @video.timed_out? %>
<div class="video">
<p><%= @video.title %></p>
</div>
<% else %>
<p>Video temporarily unavailable</p>
<% end %>
<div class="video">
<p><%= @video.title # => throws some sort of timeout error?! %></p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment