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

Channel: make some methods protected and mark some others as nodoc #6714

Merged
merged 1 commit into from
Sep 13, 2018
Merged
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
12 changes: 8 additions & 4 deletions src/concurrent/channel.cr
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ abstract class Channel(T)
pp.text inspect
end

def wait_for_receive
protected def wait_for_receive
@receivers << Fiber.current
end

def unwait_for_receive
protected def unwait_for_receive
@receivers.delete Fiber.current
end

def wait_for_send
protected def wait_for_send
@senders << Fiber.current
end

def unwait_for_send
protected def unwait_for_send
@senders.delete Fiber.current
end

Expand Down Expand Up @@ -117,14 +117,17 @@ abstract class Channel(T)
end
end

# :nodoc:
def send_select_action(value : T)
SendAction.new(self, value)
end

# :nodoc:
def receive_select_action
ReceiveAction.new(self)
end

# :nodoc:
struct ReceiveAction(C)
include SelectAction

Expand All @@ -148,6 +151,7 @@ abstract class Channel(T)
end
end

# :nodoc:
struct SendAction(C, T)
include SelectAction

Expand Down