Skip to content

Commit dd868ee

Browse files
committed
Add links to Readme
1 parent c8417db commit dd868ee

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,34 @@ be obeyed though. Features developed in `concurrent-ruby-edge` are expected to m
224224
*Status: will be moved to core soon.*
225225
* [LockFreeStack](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/LockFreeStack.html)
226226
*Status: missing documentation and tests.*
227+
* [Promises::Channel](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Promises/Channel.html)
228+
A first in first out channel that accepts messages with push family of methods and returns
229+
messages with pop family of methods.
230+
Pop and push operations can be represented as futures, see {#pop_op} and {#push_op}.
231+
The capacity of the channel can be limited to support back pressure, use capacity option in {#initialize}.
232+
{#pop} method blocks ans {#pop_op} returns pending future if there is no message in the channel.
233+
If the capacity is limited the {#push} method blocks and {#push_op} returns pending future.
234+
* [Cancellation](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Cancellation.html)
235+
The Cancellation abstraction provides cooperative cancellation.
236+
237+
The standard methods `Thread#raise` of `Thread#kill` available in Ruby
238+
are very dangerous (see linked the blog posts bellow).
239+
Therefore concurrent-ruby provides an alternative.
240+
241+
* <https://jvns.ca/blog/2015/11/27/why-rubys-timeout-is-dangerous-and-thread-dot-raise-is-terrifying/>
242+
* <http://www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/>
243+
* <http://blog.headius.com/2008/02/rubys-threadraise-threadkill-timeoutrb.html>
244+
245+
It provides an object which represents a task which can be executed,
246+
the task has to get the reference to the object and periodically cooperatively check that it is not cancelled.
247+
Good practices to make tasks cancellable:
248+
* check cancellation every cycle of a loop which does significant work,
249+
* do all blocking actions in a loop with a timeout then on timeout check cancellation
250+
and if ok block again with the timeout
251+
* [Throttle](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Throttle.html)
252+
A tool managing concurrency level of tasks.
253+
* [ErlangActor](http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/ErlangActor.html)
254+
Actor implementation which matches Erlang actor behaviour.
227255

228256
## Supported Ruby versions
229257

lib-edge/concurrent/edge/channel.rb

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Promises
1010
# If the capacity is limited the {#push} method blocks and {#push_op} returns pending future.
1111
#
1212
# {include:file:docs-source/channel.out.md}
13+
# @!macro warn.edge
1314
class Channel < Concurrent::Synchronization::Object
1415

1516
# TODO (pitr-ch 06-Jan-2019): rename to Conduit?, to be able to place it into Concurrent namespace?

lib-edge/concurrent/edge/erlang_actor.rb

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Concurrent
77
# This module provides actor abstraction that has same behaviour as Erlang actor.
88
#
99
# {include:file:docs-source/erlang_actor.out.md}
10+
# @!macro warn.edge
1011
module ErlangActor
1112

1213
# TODO (pitr-ch 04-Feb-2019): mode documentation.

0 commit comments

Comments
 (0)