Skip to content

Commit

Permalink
create with spy proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
withinboredom committed Jan 14, 2024
1 parent a15093b commit b52bc91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/State/OrchestrationHistory.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright ©2023 Robert Landers
* Copyright ©2024 Robert Landers
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the “Software”), to deal
Expand Down Expand Up @@ -43,6 +43,7 @@
use Bottledcode\DurablePhp\MonotonicClock;
use Bottledcode\DurablePhp\OrchestrationContext;
use Bottledcode\DurablePhp\Proxy\OrchestratorProxy;
use Bottledcode\DurablePhp\Proxy\SpyProxy;
use Bottledcode\DurablePhp\State\Ids\StateId;
use Crell\Serde\Attributes\Field;
use Crell\Serde\Attributes\SequenceField;
Expand Down Expand Up @@ -160,12 +161,13 @@ private function construct(): \Generator
$this->constructed ??= ($this->config->factory ? ($this->config->factory)($this->instance->instanceId) : null)
?? $class->newInstanceWithoutConstructor();
$proxyGenerator = ($this->config->factory ? ($this->config->factory)(OrchestratorProxy::class) : new OrchestratorProxy());
$spyGenerator = ($this->config->factory ? ($this->config->factory)(SpyProxy::class) : new SpyProxy());
try {
$taskScheduler = null;
yield static function (EventDispatcherTask $task) use (&$taskScheduler) {
$taskScheduler = $task;
};
$context = new OrchestrationContext($this->instance, $this, $taskScheduler, $proxyGenerator);
$context = new OrchestrationContext($this->instance, $this, $taskScheduler, $proxyGenerator, $spyGenerator);
try {
$result = ($this->constructed)($context);
} catch (Unwind) {
Expand Down

0 comments on commit b52bc91

Please sign in to comment.