All Projects → socketry → Socketry

socketry / Socketry

Licence: mit
High-level wrappers for Ruby sockets with advanced thread-safe timeout support

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Socketry

socketwrapper
Async/Sync networking library including UDP, TCP and TLS/TCP socket classes written in C++ 17.
Stars: ✭ 33 (-72.95%)
Mutual labels:  sockets, asyncio
Aioftp
ftp client/server for asyncio (http://aioftp.readthedocs.org)
Stars: ✭ 116 (-4.92%)
Mutual labels:  asyncio
Backoff
Python library providing function decorators for configurable backoff and retry
Stars: ✭ 1,670 (+1268.85%)
Mutual labels:  asyncio
Tgfilestream
A Telegram bot that can stream Telegram files to users over HTTP.
Stars: ✭ 113 (-7.38%)
Mutual labels:  asyncio
Zanphp
PHP开发面向C10K+的高并发SOA服务 和RPC服务首选框架
Stars: ✭ 1,451 (+1089.34%)
Mutual labels:  asyncio
Edgedb Python
EdgeDB Python Driver
Stars: ✭ 113 (-7.38%)
Mutual labels:  asyncio
Riprova
Versatile async-friendly library to retry failed operations with configurable backoff strategies
Stars: ✭ 106 (-13.11%)
Mutual labels:  asyncio
Sketal
Бот для ВКонтакте. Беседы / группы / развлечения.
Stars: ✭ 119 (-2.46%)
Mutual labels:  asyncio
Aiochan
CSP-style concurrency for Python
Stars: ✭ 116 (-4.92%)
Mutual labels:  asyncio
Tornado Sqlalchemy
SQLAlchemy support for Tornado
Stars: ✭ 112 (-8.2%)
Mutual labels:  asyncio
Ni Pyt
Materiály k předmětu NI-PYT na FIT ČVUT
Stars: ✭ 112 (-8.2%)
Mutual labels:  asyncio
Inapppy
Python In-app purchase validator for Apple AppStore and GooglePlay.
Stars: ✭ 110 (-9.84%)
Mutual labels:  asyncio
Netius
Readable, simple and fast asynchronous non-blocking network apps
Stars: ✭ 114 (-6.56%)
Mutual labels:  asyncio
Aiometer
A Python concurrency scheduling library, compatible with asyncio and trio.
Stars: ✭ 110 (-9.84%)
Mutual labels:  asyncio
Aiogram
Is a pretty simple and fully asynchronous framework for Telegram Bot API written in Python 3.7 with asyncio and aiohttp.
Stars: ✭ 2,195 (+1699.18%)
Mutual labels:  asyncio
Core
🏡 Open source home automation that puts local control and privacy first.
Stars: ✭ 48,265 (+39461.48%)
Mutual labels:  asyncio
Aiormq
Pure python AMQP 0.9.1 asynchronous client library
Stars: ✭ 112 (-8.2%)
Mutual labels:  asyncio
Aiofiles
File support for asyncio
Stars: ✭ 1,748 (+1332.79%)
Mutual labels:  asyncio
Monocle
PoGo mapper and notifier
Stars: ✭ 122 (+0%)
Mutual labels:  asyncio
Notes
let me know if my notes help you :D (it's a mess, I know)
Stars: ✭ 119 (-2.46%)
Mutual labels:  asyncio

Socketry

Gem Version Build Status Code Climate Coverage Status MIT licensed

High-level Ruby socket library with support for TCP, UDP, and SSL sockets.

Implements thread-safe timeouts using asynchronous I/O and high-precision monotonic timers.

Motivation

By default, Ruby sockets do not provide a built-in timeout mechanism. The only timeout mechanism provided by the language leverages timeout.rb, which uses unsafe multithreaded behaviors to implement timeouts.

While Socketry provides a synchronous, blocking API similar to Ruby's own TCPSocket and UDPSocket classes, behind the scenes it uses non-blocking I/O to implement thread-safe timeouts.

Installation

Add this line to your application's Gemfile:

gem "socketry"

And then execute:

$ bundle

Or install it yourself as:

$ gem install socketry

Basic Usage

Below is a basic example of how to use Socketry to make an HTTPS request:

require "socketry"

socket = Socketry::SSL::Socket.connect("github.com", 443)
socket.writepartial("GET / HTTP/1.0\r\nHost: github.com\r\n\r\n")
p socket.readpartial(1024)

TCP, SSL, and UDP servers and sockets also available.

Documentation

Please see the Socketry wiki for more detailed documentation and usage notes.

YARD API documentation is also available.

Supported Ruby Versions

This library aims to support and is tested against the following Ruby versions:

  • Ruby 2.2.6+
  • Ruby 2.3
  • Ruby 2.4
  • Ruby 2.5
  • JRuby 9.1.6.0+

If something doesn't work on one of these versions, it's a bug.

This library may inadvertently work (or seem to work) on other Ruby versions, however support will only be provided for the versions listed above.

If you would like this library to support another Ruby version or implementation, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped.

Contributing

  • Fork this repository on github
  • Make your changes and send us a pull request
  • If we like them we'll merge them
  • If we've accepted a patch, feel free to ask for commit access

License

Copyright (c) 2016 Tony Arcieri. Distributed under the MIT License. See LICENSE.txt for further details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].