1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! What a source asks before each write request it sends while the engine owns a create there.
//!
//! A copy that creates an item holds an intent on the item it copies, under a lease, until it
//! links the counterpart. Each destination write it sends after its create request has to renew
//! that lease, and to stop once another attempt holds it — including the several requests one
//! plugin call can send: a GitHub create is `createIssue` and then the card's fields, its
//! relationships and, should those fail, the delete that takes the issue back. The engine cannot
//! see those requests, so it installs a [`WriteGuard`] for the length of the call and the source
//! asks it, through [`<dyn WriteGuard>::check`], immediately before sending each one.
//!
//! The guard is task-local, so a source that never asks — every one that predates this — writes
//! exactly as it did, and one that asks outside a guarded call is answered at once.
use Future;
use Arc;
use crateSourceError;
task_local!
/// Renews the engine's hold on the creates a guarded call writes for, before each request.