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

tlopo-retry

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tlopo-retry

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

tlopo-retry

Gem Version Build Status Code Climate Dependency Status Coverage Status

A reusable retry mechanism which supports timeout, cleanup and fork

Installation

Add this line to your application's Gemfile:

gem 'tlopo-retry'

And then execute:

bundle

Or install it yourself as:

gem install tlopo-retry

Usage

Simple retry usage

# That will retry 3 times with no timeout and 1 second interval
Tlopo::Retry.retry do 
  TCPSocket.new('www.google.co.uk','8080').close
end

Full options

require 'logger'
require 'socket'

# Enable logging
ENV['TLOPO_LOG_LEVEL'] = 'debug' 

require 'tlopo/retry'

Tlopo::Retry.retry({
  desc: 'check if port 8080 is open on www.google.co.uk',
  tries: 2,
  interval: 5,
  timeout: 1,
  cleanup: proc { p 'Run your cleanup code here'}
}) do 
  TCPSocket.new('www.google.co.uk','8080').close
end

Contributing

  1. Fork it ( https://github.com/[my-github-username]/kubeclient/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Test your changes with rake test rubocop, add new tests if needed.
  4. If you added a new functionality, add it to README
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create a new Pull Request

Tests

This library is tested with Minitest. Please run all tests before submitting a Pull Request, and add new tests for new functionality.

Running tests:

rake test

FAQs

Package last updated on 10 Mar 2024

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