New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

block_cache

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

block_cache

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

BlockCache

Simply, cache ruby block data in mongo.

usage:

class TwitterPoller
  include BlockCache
  
  def twitter_latest
    results = cache_overwrite_by request.path do 
      # your unreliable twitter call goes here...
    end  
    
    render :json => results.to_json
  end
end

To use wrap your flimsy external service call with this block and conditionally raise an error if failure occurs. Most gems will handle this for you but if the block raises, then previous value will be returned and no errors raised.

FAQs

Package last updated on 13 Jan 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc