SingleFlight


Object Hierarchy:

Object hierarchy for SingleFlight

Description:

public class SingleFlight : Object

Suppresses duplicate concurrent work for the same key.

SingleFlight ensures only one execution per key is running at a time. Concurrent callers for the same key wait and receive the same result.

Example:

    var group = new SingleFlight ();
var result = group.@do<int> ("user:42", () => {
return 42;
});
assert (result.isOk ());
assert (result.unwrap () == 42);


Namespace: Vala.Concurrent
Package: Valacore

Content:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object