Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asynchronous

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asynchronous

  • 4.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Asynchronous

Asynchronous Patterns for Ruby Based on Pure MRI CRuby code The goal is to use the original MRI C libs for achieve real async processing in ruby

This is good for where cpu focused for included, for example csv transformation

Example

Basic usage
require 'asynchronous'

thr = Asynchronous::Thread.new do
    "some expensive work"
end

thr.value #> "some expensive work"
With Syntax Sugar
require 'asynchronous/core_ext'

thr = async do
    "some expensive work"
end

thr.value #> "some expensive work"

Quoting Sun's Multithreaded Programming Guide:

Parallelism:

  • A condition that arises when at least two threads are executing simultaneously.

Concurrency:

  • A condition that exists when at least two threads are making progress.
  • A more generalized form of parallelism that can include time-slicing as a form of virtual parallelism
for short:

Concurrency is when two tasks can start, run, and complete in overlapping time periods. It doesn't necessarily mean they'll ever both be running at the same instant. Eg. multitasking on a single-core machine.

Parallelism is when tasks literally run at the same time. Eg. on a multicore processor.

FAQs

Package last updated on 26 Jan 2018

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