Skip to content

Commit

Permalink
Prefer Async over Async.run.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Sep 15, 2019
1 parent a7941a0 commit ac3d803
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ require 'async/http/internet'

data = {'life' => 42}

Async.run do
Async do
# Make a new internet:
internet = Async::HTTP::Internet.new

Expand Down Expand Up @@ -72,7 +72,7 @@ Here is an example showing how to download a file and save it to a local path:
require 'async'
require 'async/http/internet'

Async.run do
Async do
# Make a new internet:
internet = Async::HTTP::Internet.new

Expand Down
2 changes: 1 addition & 1 deletion examples/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# Async.logger.level = Logger::DEBUG

Async.run do |task|
Async do |task|
endpoint = Async::HTTP::Endpoint.parse("https://www.google.com")

client = Async::HTTP::Client.new(endpoint)
Expand Down
2 changes: 1 addition & 1 deletion examples/upload/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require 'async/http/client'
require 'async/http/endpoint'

Async.run do
Async do
endpoint = Async::HTTP::Endpoint.parse("http://localhost:9222")
client = Async::HTTP::Client.new(endpoint, Async::HTTP::Protocol::HTTP2)

Expand Down
2 changes: 1 addition & 1 deletion examples/upload/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Async.logger.level = Logger::DEBUG

Async.run do
Async do
server = Async::HTTP::Server.for(endpoint, protocol) do |request|
Protocol::HTTP::Response[200, {}, request.body]
end
Expand Down
2 changes: 1 addition & 1 deletion examples/upload/upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'async/http/body/file'
require 'async/http/internet'

Async.run do
Async do
internet = Async::HTTP::Internet.new

headers = [
Expand Down
2 changes: 1 addition & 1 deletion tasks/server.rake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ task :google do
require 'async'
require 'pry'

Async.run do
Async do
endpoint = Async::HTTP::Endpoint.parse("https://www.google.com")
peer = endpoint.connect
stream = Async::IO::Stream.new(peer)
Expand Down

0 comments on commit ac3d803

Please sign in to comment.