【文件属性】:
文件名称:async-io:本机 Ruby IO 和套接字的并发包装器
文件大小:94KB
文件格式:ZIP
更新时间:2021-08-05 07:25:35
ruby sockets concurrency io Ruby
异步::IO
Async::IO 提供基于构建,并为IO 、 Socket和相关类提供异步包装器。
安装
将此行添加到应用程序的 Gemfile 中:
gem 'async-io'
然后执行:
$ bundle
或者自己安装:
$ gem install async-io
用法
基本回显服务器(来自spec/async/io/echo_spec.rb ):
require 'async/io'
def echo_server ( endpoint )
Async do | task |
# This is a synchronous block within the current task:
endpoint . accept do | client |
# This is an asynchronous block within th
【文件预览】:
async-io-master
----gems()
--------async-v1.rb(105B)
--------async-head.rb(137B)
----.github()
--------workflows()
----gems.rb(244B)
----.rspec(55B)
----examples()
--------issues()
--------defer()
--------udp()
--------echo()
--------chat()
--------udp.rb(536B)
--------allocations()
--------millions()
----spec()
--------addrinfo.rb(286B)
--------async()
--------spec_helper.rb(358B)
----.gitignore(132B)
----lib()
--------async()
----README.md(6KB)
----async-io.gemspec(746B)
----.editorconfig(52B)