-
Notifications
You must be signed in to change notification settings - Fork 11
/
Storage.php
55 lines (49 loc) · 1.11 KB
/
Storage.php
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
55
<?php
namespace PrestaShop\CircuitBreaker\Contracts;
use PrestaShop\CircuitBreaker\Exceptions\TransactionNotFound;
/**
* Store the transaction between the Circuit Breaker
* and the tiers service.
*/
interface Storage
{
/**
* Save the CircuitBreaker transaction.
*
* @var string The service name
* @var Transaction $transaction the transaction
*
* @return bool
*
* @param mixed $service
*/
public function saveTransaction($service, Transaction $transaction);
/**
* Retrieve the CircuitBreaker transaction for a specific service.
*
* @var string the service name
*
* @throws TransactionNotFound
*
* @return Transaction
*
* @param mixed $service
*/
public function getTransaction($service);
/**
* Checks if the transaction exists.
*
* @var string the service name
*
* @return bool
*
* @param mixed $service
*/
public function hasTransaction($service);
/**
* Clear the Circuit Breaker storage.
*
* @return bool
*/
public function clear();
}