handoff_machines 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,375 @@
1
+ //! `HandoffMachines::Handoff`: the coordinator.
2
+ use std::cell::RefCell;
3
+
4
+ use std::time::Duration;
5
+
6
+ use handoff_machines::{Acked, FencingToken, Refusal, Ticket};
7
+ use magnus::{Error, Integer, IntoValue, RArray, Ruby, Value, prelude::*, typed_data::Obj};
8
+ use matryona_machines::ruby::{Symbols, fencing, instant, integer, keep, nanoseconds, optional};
9
+
10
+ use crate::classes::classes;
11
+ use crate::values::{self, Family};
12
+ use crate::{Core, names};
13
+
14
+ type Outcome = Result<Acked, Refusal>;
15
+
16
+ /// A ticket, a replica and an offset or checkpoint, converted in that order.
17
+ fn report(
18
+ ruby: &Ruby,
19
+ (ticket, replica, value, now): (Value, Value, Value, Value),
20
+ name: &str,
21
+ ) -> Result<(Ticket, u64, u64, Duration), Error> {
22
+ let (ticket, replica) = (values::ticket(ruby, ticket)?, integer(replica, "replica")?);
23
+ Ok((ticket, replica, integer(value, name)?, instant(now, "now")?))
24
+ }
25
+
26
+ /// A ticket, a replica and a `now`, converted in that order.
27
+ fn settle(
28
+ ruby: &Ruby,
29
+ ticket: Value,
30
+ replica: Value,
31
+ now: Value,
32
+ ) -> Result<(Ticket, u64, Duration), Error> {
33
+ let (ticket, replica) = (values::ticket(ruby, ticket)?, integer(replica, "replica")?);
34
+ Ok((ticket, replica, instant(now, "now")?))
35
+ }
36
+
37
+ /// A refusal's symbol.
38
+ fn refused(ruby: &Ruby, refusal: Refusal) -> Value {
39
+ names::Refusals::symbol(ruby, refusal).as_value()
40
+ }
41
+
42
+ /// A `Recorded` or `Duplicate` when honoured, built by its `new`, or the
43
+ /// refusal symbol.
44
+ fn acked(ruby: &Ruby, outcome: Outcome) -> Result<Value, Error> {
45
+ let classes = classes(ruby)?;
46
+ let (class, phase) = match outcome {
47
+ Ok(Acked::Recorded(reached)) => (classes.recorded, reached),
48
+ Ok(Acked::Duplicate(stands)) => (classes.duplicate, stands),
49
+ Err(refusal) => return Ok(refused(ruby, refusal)),
50
+ };
51
+ let phase = names::Phases::symbol(ruby, phase);
52
+ class.get(ruby).funcall("new", (phase,))
53
+ }
54
+
55
+ #[magnus::wrap(class = "HandoffMachines::Handoff", free_immediately, size)]
56
+ pub struct Handoff {
57
+ core: RefCell<Core>,
58
+ }
59
+
60
+ impl Handoff {
61
+ pub fn with_scope(ruby: &Ruby, limits: Value, scope: Value) -> Result<Self, Error> {
62
+ let (limits, scope) = (values::limits(ruby, limits)?, integer(scope, "scope")?);
63
+ Ok(Self {
64
+ core: RefCell::new(Core::with_scope(limits, scope)),
65
+ })
66
+ }
67
+
68
+ pub fn restored(
69
+ ruby: &Ruby,
70
+ limits: Value,
71
+ scope: Value,
72
+ last_generation: Value,
73
+ ) -> Result<Self, Error> {
74
+ let (limits, scope) = (values::limits(ruby, limits)?, integer(scope, "scope")?);
75
+ let last_generation = optional(last_generation, "last_generation")?;
76
+ Core::restored(limits, scope, last_generation)
77
+ .map(|core| Self {
78
+ core: RefCell::new(core),
79
+ })
80
+ .ok_or_else(|| {
81
+ Error::new(
82
+ ruby.exception_range_error(),
83
+ "last_generation is not a generation of this scope",
84
+ )
85
+ })
86
+ }
87
+
88
+ pub fn scope(&self) -> u16 {
89
+ self.core.borrow().scope()
90
+ }
91
+
92
+ pub fn limits(ruby: &Ruby, this: &Self) -> (Integer, usize) {
93
+ let limits = this.core.borrow().limits();
94
+ (
95
+ nanoseconds(ruby, limits.phase_budget()),
96
+ limits.per_replica(),
97
+ )
98
+ }
99
+
100
+ /// A `Ticket` when honoured, built by its `new` while the decision is
101
+ /// held on a copy (clone-then-keep), or the refusal symbol.
102
+ #[allow(clippy::too_many_arguments)] // The core's arguments, in order.
103
+ pub fn start(
104
+ ruby: &Ruby,
105
+ this: Obj<Self>,
106
+ partition: Value,
107
+ source: Value,
108
+ target: Value,
109
+ base: Value,
110
+ source_token: Value,
111
+ now: Value,
112
+ ) -> Result<Value, Error> {
113
+ this.check_frozen()?;
114
+ let (partition, source) = (integer(partition, "partition")?, integer(source, "source")?);
115
+ let (target, base) = (integer(target, "target")?, integer(base, "base")?);
116
+ let held = fencing::token::<Family>(ruby, source_token)?;
117
+ let now = instant(now, "now")?;
118
+ let class = classes(ruby)?.ticket.get(ruby);
119
+ let start = |core: &mut Core| core.start(partition, source, target, base, held, now);
120
+ keep(ruby, this, &this.core, start, |started| match started {
121
+ Ok(ticket) => class.funcall("new", (ticket.partition(), ticket.generation())),
122
+ Err(refusal) => Ok(refused(ruby, refusal)),
123
+ })
124
+ }
125
+
126
+ /// Every acknowledgement. Frozen is checked and everything that can raise
127
+ /// happens before the core is called; the answer is built while the
128
+ /// decision is held on a copy, kept only once it exists (clone-then-keep).
129
+ fn ack(
130
+ ruby: &Ruby,
131
+ this: Obj<Self>,
132
+ ack: impl FnOnce(&mut Core) -> Outcome,
133
+ ) -> Result<Value, Error> {
134
+ keep(ruby, this, &this.core, ack, |outcome| acked(ruby, outcome))
135
+ }
136
+
137
+ pub fn quiesced(
138
+ ruby: &Ruby,
139
+ this: Obj<Self>,
140
+ ticket: Value,
141
+ replica: Value,
142
+ until: Value,
143
+ now: Value,
144
+ ) -> Result<Value, Error> {
145
+ this.check_frozen()?;
146
+ let (ticket, replica, until, now) = report(ruby, (ticket, replica, until, now), "until")?;
147
+ Self::ack(ruby, this, |core| {
148
+ core.quiesced(ticket, replica, until, now)
149
+ })
150
+ }
151
+
152
+ pub fn drained(
153
+ ruby: &Ruby,
154
+ this: Obj<Self>,
155
+ ticket: Value,
156
+ replica: Value,
157
+ offset: Value,
158
+ now: Value,
159
+ ) -> Result<Value, Error> {
160
+ this.check_frozen()?;
161
+ let (ticket, replica, offset, now) =
162
+ report(ruby, (ticket, replica, offset, now), "offset")?;
163
+ Self::ack(ruby, this, |core| {
164
+ core.drained(ticket, replica, offset, now)
165
+ })
166
+ }
167
+
168
+ pub fn committed(
169
+ ruby: &Ruby,
170
+ this: Obj<Self>,
171
+ ticket: Value,
172
+ replica: Value,
173
+ offset: Value,
174
+ now: Value,
175
+ ) -> Result<Value, Error> {
176
+ this.check_frozen()?;
177
+ let (ticket, replica, offset, now) =
178
+ report(ruby, (ticket, replica, offset, now), "offset")?;
179
+ Self::ack(ruby, this, |core| {
180
+ core.committed(ticket, replica, offset, now)
181
+ })
182
+ }
183
+
184
+ pub fn captured(
185
+ ruby: &Ruby,
186
+ this: Obj<Self>,
187
+ ticket: Value,
188
+ replica: Value,
189
+ checkpoint: Value,
190
+ now: Value,
191
+ ) -> Result<Value, Error> {
192
+ this.check_frozen()?;
193
+ let fields = (ticket, replica, checkpoint, now);
194
+ let (ticket, replica, checkpoint, now) = report(ruby, fields, "checkpoint")?;
195
+ Self::ack(ruby, this, |core| {
196
+ core.captured(ticket, replica, checkpoint, now)
197
+ })
198
+ }
199
+
200
+ pub fn installed(
201
+ ruby: &Ruby,
202
+ this: Obj<Self>,
203
+ ticket: Value,
204
+ replica: Value,
205
+ checkpoint: Value,
206
+ now: Value,
207
+ ) -> Result<Value, Error> {
208
+ this.check_frozen()?;
209
+ let fields = (ticket, replica, checkpoint, now);
210
+ let (ticket, replica, checkpoint, now) = report(ruby, fields, "checkpoint")?;
211
+ Self::ack(ruby, this, |core| {
212
+ core.installed(ticket, replica, checkpoint, now)
213
+ })
214
+ }
215
+
216
+ pub fn fenced(
217
+ ruby: &Ruby,
218
+ this: Obj<Self>,
219
+ ticket: Value,
220
+ token: Value,
221
+ now: Value,
222
+ ) -> Result<Value, Error> {
223
+ this.check_frozen()?;
224
+ let (ticket, token) = (
225
+ values::ticket(ruby, ticket)?,
226
+ fencing::token::<Family>(ruby, token)?,
227
+ );
228
+ let now = instant(now, "now")?;
229
+ Self::ack(ruby, this, |core| core.fenced(ticket, token, now))
230
+ }
231
+
232
+ pub fn activated(
233
+ ruby: &Ruby,
234
+ this: Obj<Self>,
235
+ ticket: Value,
236
+ replica: Value,
237
+ token: Value,
238
+ now: Value,
239
+ ) -> Result<Value, Error> {
240
+ this.check_frozen()?;
241
+ let (ticket, replica) = (values::ticket(ruby, ticket)?, integer(replica, "replica")?);
242
+ let (token, now) = (fencing::token::<Family>(ruby, token)?, instant(now, "now")?);
243
+ Self::ack(ruby, this, |core| {
244
+ core.activated(ticket, replica, token, now)
245
+ })
246
+ }
247
+
248
+ pub fn abort(
249
+ ruby: &Ruby,
250
+ this: Obj<Self>,
251
+ ticket: Value,
252
+ token: Option<Value>,
253
+ now: Value,
254
+ ) -> Result<Value, Error> {
255
+ this.check_frozen()?;
256
+ let ticket = values::ticket(ruby, ticket)?;
257
+ let token = token
258
+ .map(|token| fencing::token::<Family>(ruby, token))
259
+ .transpose()?;
260
+ let now = instant(now, "now")?;
261
+ Self::ack(ruby, this, |core| core.abort(ticket, token, now))
262
+ }
263
+
264
+ pub fn resumed(
265
+ ruby: &Ruby,
266
+ this: Obj<Self>,
267
+ ticket: Value,
268
+ replica: Value,
269
+ now: Value,
270
+ ) -> Result<Value, Error> {
271
+ this.check_frozen()?;
272
+ let (ticket, replica, now) = settle(ruby, ticket, replica, now)?;
273
+ Self::ack(ruby, this, |core| core.resumed(ticket, replica, now))
274
+ }
275
+
276
+ pub fn discarded(
277
+ ruby: &Ruby,
278
+ this: Obj<Self>,
279
+ ticket: Value,
280
+ replica: Value,
281
+ now: Value,
282
+ ) -> Result<Value, Error> {
283
+ this.check_frozen()?;
284
+ let (ticket, replica, now) = settle(ruby, ticket, replica, now)?;
285
+ Self::ack(ruby, this, |core| core.discarded(ticket, replica, now))
286
+ }
287
+
288
+ pub fn status(ruby: &Ruby, this: &Self, partition: Value) -> Result<Option<Value>, Error> {
289
+ let partition = integer(partition, "partition")?;
290
+ let Some(status) = this.core.borrow().status(partition) else {
291
+ return Ok(None);
292
+ };
293
+ let head = (
294
+ status.ticket().partition(),
295
+ status.ticket().generation(),
296
+ status.source(),
297
+ status.target(),
298
+ names::Phases::symbol(ruby, status.phase()),
299
+ );
300
+ let tail = (
301
+ status.base(),
302
+ status.until(),
303
+ status.checkpoint(),
304
+ status.token().map(FencingToken::raw),
305
+ nanoseconds(ruby, status.deadline()),
306
+ );
307
+ Ok(Some((head, tail).into_value_with(ruby)))
308
+ }
309
+
310
+ pub fn orders(
311
+ ruby: &Ruby,
312
+ this: &Self,
313
+ from: Value,
314
+ limit: Value,
315
+ ) -> Result<(RArray, usize), Error> {
316
+ let (from, limit) = (integer(from, "from")?, integer(limit, "limit")?);
317
+ let core = this.core.borrow();
318
+ let mut pass = core.orders(from);
319
+ let list = ruby.ary_new();
320
+ for order in pass.by_ref().take(limit) {
321
+ let (to, action, value) = names::order(ruby, &order);
322
+ let ticket = order.ticket();
323
+ list.push((ticket.partition(), ticket.generation(), to, action, value))?;
324
+ }
325
+ Ok((list, pass.position()))
326
+ }
327
+
328
+ pub fn outstanding(
329
+ ruby: &Ruby,
330
+ this: &Self,
331
+ ticket: Value,
332
+ from: Value,
333
+ limit: Value,
334
+ ) -> Result<Value, Error> {
335
+ let (ticket, from) = (values::ticket(ruby, ticket)?, integer(from, "from")?);
336
+ let limit: usize = integer(limit, "limit")?;
337
+ let core = this.core.borrow();
338
+ Ok(match core.outstanding(ticket, from) {
339
+ Ok(missing) => {
340
+ let list = ruby.ary_new();
341
+ for offset in missing.take(limit) {
342
+ list.push(offset)?;
343
+ }
344
+ list.as_value()
345
+ }
346
+ Err(refusal) => refused(ruby, refusal),
347
+ })
348
+ }
349
+
350
+ pub fn overdue(
351
+ ruby: &Ruby,
352
+ this: &Self,
353
+ now: Value,
354
+ from: Value,
355
+ limit: Value,
356
+ ) -> Result<(RArray, usize), Error> {
357
+ let (now, from) = (instant(now, "now")?, integer(from, "from")?);
358
+ let limit = integer(limit, "limit")?;
359
+ let core = this.core.borrow();
360
+ let mut pass = core.overdue(now, from);
361
+ let list = ruby.ary_new();
362
+ for ticket in pass.by_ref().take(limit) {
363
+ list.push((ticket.partition(), ticket.generation()))?;
364
+ }
365
+ Ok((list, pass.position()))
366
+ }
367
+
368
+ pub fn active(&self) -> usize {
369
+ self.core.borrow().active()
370
+ }
371
+
372
+ pub fn generation(&self) -> Option<u64> {
373
+ self.core.borrow().generation()
374
+ }
375
+ }
@@ -0,0 +1,62 @@
1
+ //! Private native entry point.
2
+ use crate::values::{self, Family};
3
+ use crate::{CAPACITY, Core, Handoff, classes, names, scope_of};
4
+ use magnus::{Error, Ruby, function, method, prelude::*};
5
+ use matryona_machines::ruby::{Class, Symbols, fencing};
6
+
7
+ #[magnus::init]
8
+ fn init(ruby: &Ruby) -> Result<(), Error> {
9
+ let module = ruby.define_module("HandoffMachines")?;
10
+ classes::resolve(ruby, module)?;
11
+ module.const_set("CAPACITY", CAPACITY)?;
12
+ module.const_set("WINDOW", Core::WINDOW)?;
13
+ module.const_set("PHASES", names::Phases::every(ruby))?;
14
+ module.const_set("REFUSALS", names::Refusals::every(ruby))?;
15
+ let raw = function!(fencing::validate_raw::<Family>, 1);
16
+ module.define_singleton_method("native_raw", raw)?;
17
+ let scope = function!(fencing::token_scope::<Family>, 1);
18
+ module.define_singleton_method("native_token_scope", scope)?;
19
+ let order = function!(fencing::token_order::<Family>, 2);
20
+ module.define_singleton_method("native_token_order", order)?;
21
+ let newer = function!(fencing::token_newer::<Family>, 2);
22
+ module.define_singleton_method("native_token_newer", newer)?;
23
+ module.define_singleton_method("__limits", function!(values::check_limits, 2))?;
24
+ module.define_singleton_method("__ticket", function!(values::check_ticket, 2))?;
25
+ module.define_singleton_method("__recorded", function!(values::check_recorded, 1))?;
26
+ module.define_singleton_method("__duplicate", function!(values::check_duplicate, 1))?;
27
+ module.define_singleton_method("__replica", function!(values::check_replica, 1))?;
28
+ module.define_singleton_method("__drain", function!(values::check_drain, 1))?;
29
+ module.define_singleton_method("__capture", function!(values::check_capture, 1))?;
30
+ module.define_singleton_method("__install", function!(values::check_install, 1))?;
31
+ let token = function!(fencing::own_token::<Family>, 1);
32
+ module.define_singleton_method("__token", token)?;
33
+ module.define_singleton_method("__order", function!(values::check_order, 3))?;
34
+ module.define_singleton_method("__status", function!(values::check_status, 9))?;
35
+ let class = module.define_class("Handoff", ruby.class_object())?;
36
+ class.undef_default_alloc_func();
37
+ class.define_singleton_method("native_with_scope", function!(Handoff::with_scope, 2))?;
38
+ class.define_singleton_method("native_restored", function!(Handoff::restored, 3))?;
39
+ class.define_singleton_method("native_scope_of", function!(scope_of, 1))?;
40
+ class.define_method("scope", method!(Handoff::scope, 0))?;
41
+ class.define_private_method("native_limits", method!(Handoff::limits, 0))?;
42
+ class.define_method("start", method!(Handoff::start, 6))?;
43
+ class.define_method("quiesced", method!(Handoff::quiesced, 4))?;
44
+ class.define_method("drained", method!(Handoff::drained, 4))?;
45
+ class.define_method("committed", method!(Handoff::committed, 4))?;
46
+ class.define_method("captured", method!(Handoff::captured, 4))?;
47
+ class.define_method("installed", method!(Handoff::installed, 4))?;
48
+ class.define_method("fenced", method!(Handoff::fenced, 3))?;
49
+ class.define_method("activated", method!(Handoff::activated, 4))?;
50
+ class.define_method("abort", method!(Handoff::abort, 3))?;
51
+ class.define_method("resumed", method!(Handoff::resumed, 3))?;
52
+ class.define_method("discarded", method!(Handoff::discarded, 3))?;
53
+ class.define_private_method("native_status", method!(Handoff::status, 1))?;
54
+ class.define_private_method("native_orders", method!(Handoff::orders, 2))?;
55
+ class.define_method("outstanding", method!(Handoff::outstanding, 3))?;
56
+ class.define_private_method("native_overdue", method!(Handoff::overdue, 3))?;
57
+ class.define_method("active", method!(Handoff::active, 0))?;
58
+ class.define_method("generation", method!(Handoff::generation, 0))?;
59
+ // `native_with_scope` and `native_restored` answer a Handoff: its class
60
+ // is fixed now, before either runs.
61
+ Class::pin_wrapped::<Handoff>(ruby, class).map(drop)
62
+ }
@@ -0,0 +1,36 @@
1
+ //! Thin binding to the bounded partition handoff coordinator.
2
+ mod classes;
3
+ mod handoff;
4
+ mod init;
5
+ mod names;
6
+ mod values;
7
+
8
+ use handoff_machines::Ticket;
9
+ use magnus::{Error, Ruby, Value};
10
+ use matryona_machines::ruby::integer;
11
+
12
+ use handoff::Handoff;
13
+
14
+ /// Concurrent transfers compiled into the binding.
15
+ const CAPACITY: usize = 16;
16
+ /// Drain window words: 64 offsets each.
17
+ const WORDS: usize = 4;
18
+
19
+ type Core = handoff_machines::Handoff<CAPACITY, WORDS>;
20
+
21
+ /// The scope a ticket's generation carries: `Ticket#scope`.
22
+ fn scope_of(ruby: &Ruby, ticket: Value) -> Result<u16, Error> {
23
+ values::ticket(ruby, ticket).map(|ticket| ticket.scope())
24
+ }
25
+
26
+ /// The core's `Ticket::new` of two Integers, or the `RangeError` its `None`
27
+ /// stands for.
28
+ fn ticket(ruby: &Ruby, partition: Value, generation: Value) -> Result<Ticket, Error> {
29
+ let partition = integer(partition, "partition")?;
30
+ Ticket::new(partition, integer(generation, "generation")?).ok_or_else(|| {
31
+ Error::new(
32
+ ruby.exception_range_error(),
33
+ "no coordinator issues a generation with a zero sequence",
34
+ )
35
+ })
36
+ }
@@ -0,0 +1,86 @@
1
+ //! Symbol names for the core's phases, refusals and orders.
2
+ use handoff_machines::{Action, FencingToken, Order, Phase, Recipient, Refusal};
3
+ use magnus::{IntoValue, Ruby, Symbol, Value, prelude::*};
4
+ use matryona_machines::ruby::SymbolNames;
5
+
6
+ matryona_machines::symbols! {
7
+ /// The core's phases as Symbols: `TypeError` for a non-Symbol,
8
+ /// `RangeError` for a Symbol that names no phase.
9
+ pub Phases for Phase as "phase" {
10
+ Quiesce => "quiesce",
11
+ Drain => "drain",
12
+ Checkpoint => "checkpoint",
13
+ Activate => "activate",
14
+ Rollback => "rollback",
15
+ Complete => "complete",
16
+ Aborted => "aborted",
17
+ }
18
+ }
19
+
20
+ matryona_machines::symbols! {
21
+ /// The core's refusals as Symbols: the snake case of each variant.
22
+ pub Refusals for Refusal as "a refusal" {
23
+ Full => "full",
24
+ Busy => "busy",
25
+ ReplicaBusy => "replica_busy",
26
+ SameReplica => "same_replica",
27
+ Exhausted => "exhausted",
28
+ ClockRegressed => "clock_regressed",
29
+ Stale => "stale",
30
+ Unknown => "unknown",
31
+ OutOfPhase => "out_of_phase",
32
+ WrongReplica => "wrong_replica",
33
+ BehindBase => "behind_base",
34
+ BeyondDrain => "beyond_drain",
35
+ OutOfWindow => "out_of_window",
36
+ Unacked => "unacked",
37
+ Mismatch => "mismatch",
38
+ StaleToken => "stale_token",
39
+ FenceRequired => "fence_required",
40
+ }
41
+ }
42
+
43
+ matryona_machines::symbols! {
44
+ /// The core's recipients as Symbols: `:authority` reads back; a
45
+ /// replica is its `Replica`.
46
+ pub Recipients for Recipient as "a recipient" => names_only {
47
+ Replica(..) => "replica",
48
+ Authority => "authority",
49
+ }
50
+ }
51
+
52
+ matryona_machines::symbols! {
53
+ /// The core's actions as Symbols: `:quiesce` and `:discard` read back;
54
+ /// every other action is its `Data`.
55
+ pub Actions for Action as "an action" => names_only {
56
+ Quiesce => "quiesce",
57
+ Drain { .. } => "drain",
58
+ Capture { .. } => "capture",
59
+ Install { .. } => "install",
60
+ Fence { .. } => "fence",
61
+ Activate { .. } => "activate",
62
+ Resume { .. } => "resume",
63
+ Discard => "discard",
64
+ }
65
+ }
66
+
67
+ /// Recipient (replica Integer or `:authority`), action name and its field
68
+ /// (a token as its raw Integer);
69
+ /// the Ruby side wraps them as `Replica` and the action `Data` values.
70
+ pub fn order(ruby: &Ruby, order: &Order) -> (Value, Symbol, Option<u64>) {
71
+ let to = match order.to() {
72
+ Recipient::Replica(replica) => replica.into_value_with(ruby),
73
+ Recipient::Authority => Recipients::symbol(ruby, &Recipient::Authority).as_value(),
74
+ };
75
+ let action = order.action();
76
+ let value = match action {
77
+ Action::Quiesce | Action::Discard => None,
78
+ Action::Drain { until } => Some(until),
79
+ Action::Capture { at } => Some(at),
80
+ Action::Install { checkpoint } => Some(checkpoint),
81
+ Action::Fence { above } => Some(above.raw()),
82
+ Action::Activate { token } => Some(token.raw()),
83
+ Action::Resume { token } => token.map(FencingToken::raw),
84
+ };
85
+ (to, Actions::symbol(ruby, &action), value)
86
+ }