Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-03-05 11:30:11 +0300
committerdiosmosis <benaka@piwik.pro>2015-03-05 11:30:11 +0300
commit51984c0bbff0a55d6ff6801f09546dc6b417be1a (patch)
tree0954a44f3ead460d66b90a5969b1356a2bc13fad /core/Concurrency
parent5d80515873d503abcc1adbd43da919ebf080160b (diff)
Refs #7181, fill in TODO docs.
Diffstat (limited to 'core/Concurrency')
-rw-r--r--core/Concurrency/DistributedList.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/core/Concurrency/DistributedList.php b/core/Concurrency/DistributedList.php
index 2f37fe0e4b..3823b4b47f 100644
--- a/core/Concurrency/DistributedList.php
+++ b/core/Concurrency/DistributedList.php
@@ -10,21 +10,27 @@ namespace Piwik\Concurrency;
use Piwik\Option;
/**
- * TODO
+ * Manages a simple distributed list stored in an Option. No locking occurs, so the list
+ * is not thread safe, and should only be used for use cases where atomicity is not
+ * important.
*
- * TODO: tests
+ * The list of items is serialized and stored in an Option. Items are converted to string
+ * before being persisted, so it is not expected to unserialize objects.
+ * TODO: light integration tests
*/
class DistributedList
{
/**
- * TODO
+ * The name of the option to store the list in.
*
* @var string
*/
private $optionName;
/**
- * TODO
+ * Constructor.
+ *
+ * @param string $optionName
*/
public function __construct($optionName)
{
@@ -32,7 +38,7 @@ class DistributedList
}
/**
- * TODO
+ * Queries the option table and returns all items in this list.
*
* @return array
*/
@@ -51,7 +57,7 @@ class DistributedList
}
/**
- * TODO
+ * Sets the contents of the list in the option table.
*
* @param string[] $items
*/
@@ -65,7 +71,7 @@ class DistributedList
}
/**
- * TODO
+ * Adds one or more items to the list in the option table.
*
* @param string|array $item
*/
@@ -82,8 +88,7 @@ class DistributedList
}
/**
- * TODO
- * TODO: support removing multiple
+ * Removes one or more items by value from the list in the optiontable.
*
* @param string|array $items
*/