woocommerce-pos
/
vendor_prefixed
/
phpfastcache
/
phpfastcache
/
lib
/
Phpfastcache
/
Cluster
/
AggregatorInterface.php
AggregatorInterface.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.9.16, at vendor_prefixed/phpfastcache/phpfastcache/lib/Phpfastcache/Cluster/AggregatorInterface.php
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * |
| 5 | * This file is part of phpFastCache. |
| 6 | * |
| 7 | * @license MIT License (MIT) |
| 8 | * |
| 9 | * For full copyright and license information, please see the docs/CREDITS.txt file. |
| 10 | * |
| 11 | * @author Georges.L (Geolim4) <contact@geolim4.com> |
| 12 | * |
| 13 | */ |
| 14 | declare (strict_types=1); |
| 15 | namespace WCPOS\Vendor\Phpfastcache\Cluster; |
| 16 | |
| 17 | use WCPOS\Vendor\Phpfastcache\Config\ConfigurationOption; |
| 18 | /** |
| 19 | * Interface AggregatorInterface |
| 20 | * |
| 21 | * @package Phpfastcache\Cluster |
| 22 | */ |
| 23 | interface AggregatorInterface |
| 24 | { |
| 25 | /** |
| 26 | * Full replication mechanism |
| 27 | * |
| 28 | * Read on first working (and synchronize if needed, no failure allowed), |
| 29 | * Write on all (no failure allowed), |
| 30 | * Delete on all (no failure allowed) |
| 31 | * |
| 32 | * Conflict on multiple reads: Keep first found item (but sync the others) |
| 33 | * Cluster size: 2 minimum, unlimited |
| 34 | */ |
| 35 | public const STRATEGY_FULL_REPLICATION = 1; |
| 36 | /** |
| 37 | * Semi replication mechanism |
| 38 | * |
| 39 | * Read first working (but do not synchronize, with partial failure allowed), |
| 40 | * Write on all (with partial failure allowed) |
| 41 | * Delete on all (with partial failure allowed) |
| 42 | * |
| 43 | * Conflict on multiple reads: Keep first found item |
| 44 | * Cluster size: 2 minimum, unlimited |
| 45 | */ |
| 46 | public const STRATEGY_SEMI_REPLICATION = 2; |
| 47 | /** |
| 48 | * First pool is master, second is slave |
| 49 | * |
| 50 | * Read from master (but do not synchronize, with master failure only allowed) |
| 51 | * Write on all (with master failure only allowed) |
| 52 | * Delete on all (with master failure only allowed) |
| 53 | * |
| 54 | * Conflict on multiple reads: No, master is exclusive source except if it fails |
| 55 | * Cluster size: 2 exactly: Master & Slave (Exception if more or less) |
| 56 | */ |
| 57 | public const STRATEGY_MASTER_SLAVE = 4; |
| 58 | /** |
| 59 | * Mostly used for development testing |
| 60 | * |
| 61 | * CRUD operations are made on a random-chosen backend from a given cluster. |
| 62 | * This means you have 1 chance out of (n count of pools) to find an existing cache item |
| 63 | * but also to write/delete an non-existing item. |
| 64 | */ |
| 65 | public const STRATEGY_RANDOM_REPLICATION = 8; |
| 66 | /** |
| 67 | * AggregatorInterface constructor. |
| 68 | * |
| 69 | * @param string $clusterAggregatorName |
| 70 | * @param AggregatablePoolInterface ...$driverPools |
| 71 | */ |
| 72 | public function __construct(string $clusterAggregatorName, AggregatablePoolInterface ...$driverPools); |
| 73 | /** |
| 74 | * @param int $strategy |
| 75 | * |
| 76 | * @return ClusterPoolInterface |
| 77 | */ |
| 78 | public function getCluster(int $strategy) : ClusterPoolInterface; |
| 79 | /** |
| 80 | * @param string $driverName |
| 81 | * @param ConfigurationOption|NULL $driverConfig |
| 82 | * |
| 83 | * @return void |
| 84 | */ |
| 85 | public function aggregateNewDriver(string $driverName, ConfigurationOption $driverConfig = null) : void; |
| 86 | /** |
| 87 | * @param AggregatablePoolInterface $driverPool |
| 88 | */ |
| 89 | public function aggregateDriver(AggregatablePoolInterface $driverPool) : void; |
| 90 | /** |
| 91 | * @param AggregatablePoolInterface $driverPool |
| 92 | */ |
| 93 | public function disaggregateDriver(AggregatablePoolInterface $driverPool) : void; |
| 94 | } |
| 95 |