Skip to content

Instantly share code, notes, and snippets.

View fritz-gerneth's full-sized avatar

Fritz Gerneth fritz-gerneth

  • funct GmbH
  • Munich
View GitHub Profile
<?php
class LockService
{
public function tryAcquireLocationLock(
LocationLock $lock,
IdInterface $owner,
?DateTimeImmutable $expirationDate
): bool {
try {
<?php
declare(strict_types=1);
namespace Funct\Ion\Microsite\Base\ReadModel\MicrositeCollections;
use Prooph\EventStore\Projection\AbstractReadModel;
use RuntimeException;
final class CombinedReadModel extends AbstractReadModel
Producers | Events Per Producer | Gaps | Events per gap
-------------------------------------------------------
2 | 50005 | 350 | 29
4 | 50005 | 1916 | 104
6 | 50005 | 1153 | 260
8 | 50005 | 23 | 17393
10 | 50005 | 2 | 250025
Producers | Events Per Producer | Events/sec / producer | Events/sec total | Lock
<?php
final class SyncedIdentityRepository extends AggregateRepository
{
public function get(ExternalId $id)
{
$aggregate = $this->getAggregateRoot($id->__toString());
if (null === $aggregate) {
$aggregate = new SyncedIdentity::create($id);
}
<?php
class ErrorLoggerPlugin extends AbstractPlugin
{
/** @var Logger */
private $logger;
public function __construct(Logger $logger)
{
$this->logger = $logger;
<?php
final class BigIdSingleStreamStrategy implements PersistenceStrategy, HasQueryHint
{
/**
* @param string $tableName
* @return string[]
*/
public function createSchema(string $tableName): array
{
<?php
declare(strict_types=1);
namespace Funct\Ion\Common\Library\Cqrs\ServiceBus;
use JsonSerializable;
use Prooph\Common\Messaging\Message;
final class IdentityCausationData implements JsonSerializable
Your PHP Version is 7.1.6, so "real-world-test" is skipped
You don't have pthreads installed, so "real-world-test" is skipped
mysql: set up event store tables on database event_store_tests
test 1 create 10 streams with 100 events in each stream, using 1 event per commit
test 1 using mysql took 1.010272026062 seconds
test 1 using mysql writes 989.83241562963 events per second
<?php
class ProcessorFactory
{
public function __invoke(ContainerInterface $container)
{
$processor = new Processor(
$container->get(Schema::class)
);
$processor->getExecutionContext()->getContainer()->set(
<?php
class SingleGroupQuery extends AbstractField
{
use ServiceLocatorAwareTrait;
/**
* {@inheritdoc}
*/
public function getType()