Sha256: 1ed71c1e4cd971f1b5e0008ec66a18b608984081680c4211d100bec1259c120f
Contents?: true
Size: 1.2 KB
Versions: 1
Compression:
Stored size: 1.2 KB
Contents
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 ```ruby require 'asynchronous' thr = Asynchronous::Thread.new do "some expensive work" end thr.value #> "some expensive work" ``` #### With Syntax Sugar ```ruby 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.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
asynchronous-4.0.1 | README.md |