From bf48073c96d0c6866bb2edf944ba19be62ff9136 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Mon, 30 Sep 2019 18:16:34 +0200 Subject: Moves tacticians-server/other to 'misc' --- misc/db_bounty.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 misc/db_bounty.txt (limited to 'misc/db_bounty.txt') diff --git a/misc/db_bounty.txt b/misc/db_bounty.txt new file mode 100644 index 0000000..d31226a --- /dev/null +++ b/misc/db_bounty.txt @@ -0,0 +1,18 @@ +Designing with a "it can crash at any point" mentality ++ can't combine DB queries in an atomic manner += Potential for partially completed tasks, "corrupting" the global DB. + +A solution could be having "bounty" entries, which work as follows: +A process P0 needs to do tasks T0, then T1, then T2. +P0 creates a bounty B0: +{ + not_before: 60s. + task: T0_T1_T2. + params: [{T0.id, T1.id, 20] +} +P0 adds B0 to the Bounty DB. +P0 attempts T0, T1, and T2. +P0 removes B0 from the Bounty DB. + +There are other processes trying to access available bounties (i.e. bounties +for which the "not_before" has expired) to complete them. -- cgit v1.2.3-70-g09d2