Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Concurrent::Future and top-level methods delay, future, lazy #9093

Merged
merged 2 commits into from
Apr 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 0 additions & 131 deletions spec/std/concurrent/future_spec.cr

This file was deleted.

3 changes: 2 additions & 1 deletion spec/std/http/server/server_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require "../spec_helper"
require "http/server"
require "http/client/response"
require "../../../support/ssl"
require "../../../support/channel"

# TODO: replace with `HTTP::Client` once it supports connecting to Unix socket (#2735)
private def unix_request(path)
Expand Down Expand Up @@ -72,7 +73,7 @@ describe HTTP::Server do
end
sleep 0.1

delay(1) { ch.send :timeout }
schedule_timeout ch

TCPSocket.open(address.address, address.port) { }

Expand Down
6 changes: 4 additions & 2 deletions spec/std/io/io_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require "../spec_helper"
require "../../support/channel"

{% unless flag?(:win32) %}
require "big"
{% end %}
Expand Down Expand Up @@ -857,7 +859,7 @@ describe IO do
ch.send :end
end

delay(1) { ch.send :timeout }
schedule_timeout ch

ch.receive.should eq(:start)
wait_until_blocked f
Expand All @@ -880,7 +882,7 @@ describe IO do
ch.send :end
end

delay(1) { ch.send :timeout }
schedule_timeout ch

ch.receive.should eq(:start)
wait_until_blocked f
Expand Down
5 changes: 3 additions & 2 deletions spec/std/socket/unix_server_spec.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "../spec_helper"
require "socket"
require "../../support/fibers"
require "../../support/channel"
require "../../support/tempfile"

describe UNIXServer do
Expand Down Expand Up @@ -81,7 +82,7 @@ describe UNIXServer do
ch = Channel(Symbol).new(1)
exception = nil

delay(1) { ch.send :timeout }
schedule_timeout ch

f = spawn do
begin
Expand Down Expand Up @@ -126,7 +127,7 @@ describe UNIXServer do
ch = Channel(Symbol).new(1)
ret = :initial

delay(1) { ch.send :timeout }
schedule_timeout ch

f = spawn do
ch.send :begin
Expand Down
6 changes: 6 additions & 0 deletions spec/support/channel.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def schedule_timeout(c : Channel(Symbol))
spawn do
sleep 1
c.send(:timeout)
end
end
1 change: 0 additions & 1 deletion spec/win32_std_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ require "./std/class_spec.cr"
require "./std/colorize_spec.cr"
require "./std/comparable_spec.cr"
require "./std/complex_spec.cr"
require "./std/concurrent/future_spec.cr"
# require "./std/concurrent/select_spec.cr" (failed to run)
require "./std/concurrent_spec.cr"
# require "./std/crc32_spec.cr" (failed linking)
Expand Down
1 change: 0 additions & 1 deletion src/concurrent.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require "fiber"
require "channel"
require "crystal/scheduler"
require "./concurrent/*"

# Blocks the current fiber for the specified number of seconds.
#
Expand Down
3 changes: 0 additions & 3 deletions src/concurrent/error.cr

This file was deleted.

164 changes: 0 additions & 164 deletions src/concurrent/future.cr

This file was deleted.