-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEventStoreAdapter.php
More file actions
32 lines (26 loc) · 686 Bytes
/
EventStoreAdapter.php
File metadata and controls
32 lines (26 loc) · 686 Bytes
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
<?php
declare(strict_types=1);
namespace Wwwision\SubscriptionEngine\EventStore;
use Wwwision\SubscriptionEngine\Subscription\Position;
/**
* @template E of object
*/
interface EventStoreAdapter
{
/**
* Read events from a given starting position (0 = from beginning)
*
* @return iterable<E>
*/
public function read(Position $startPosition): iterable;
/**
* Position of the last event in the global event stream
*/
public function lastPosition(): Position;
/**
* Determine the position of a given event in the global stream
*
* @param E $event
*/
public function eventPosition(object $event): Position;
}