-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #366: polishing and improvements interceptors
Update Interceptors: polishing and improvements
- Loading branch information
Showing
38 changed files
with
410 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
src/Interceptor/Trait/WorkflowOutboundCallsInterceptorTrait.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of Temporal package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Temporal\Interceptor\Trait; | ||
|
||
use React\Promise\PromiseInterface; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\AwaitInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\AwaitWithTimeoutInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\CancelExternalWorkflowInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\CompleteInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\ContinueAsNewInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\ExecuteActivityInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\ExecuteChildWorkflowInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\ExecuteLocalActivityInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\GetVersionInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\PanicInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\SideEffectInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\SignalExternalWorkflowInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\TimerInput; | ||
use Temporal\Interceptor\WorkflowOutboundCalls\UpsertSearchAttributesInput; | ||
use Temporal\Interceptor\WorkflowOutboundCallsInterceptor; | ||
|
||
/** | ||
* Implements {@see WorkflowOutboundCallsInterceptor} | ||
*/ | ||
trait WorkflowOutboundCallsInterceptorTrait | ||
{ | ||
/** | ||
* @see WorkflowOutboundCallsInterceptor::executeActivity() | ||
*/ | ||
public function executeActivity( | ||
ExecuteActivityInput $input, | ||
callable $next, | ||
): PromiseInterface { | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::executeLocalActivity() | ||
*/ | ||
public function executeLocalActivity(ExecuteLocalActivityInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::executeChildWorkflow() | ||
*/ | ||
public function executeChildWorkflow(ExecuteChildWorkflowInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::signalExternalWorkflow() | ||
*/ | ||
public function signalExternalWorkflow(SignalExternalWorkflowInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::cancelExternalWorkflow() | ||
*/ | ||
public function cancelExternalWorkflow(CancelExternalWorkflowInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::sideEffect() | ||
*/ | ||
public function sideEffect(SideEffectInput $input, callable $next): mixed | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::timer() | ||
*/ | ||
public function timer(TimerInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::panic() | ||
*/ | ||
public function panic(PanicInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::complete() | ||
*/ | ||
public function complete(CompleteInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::continueAsNew() | ||
*/ | ||
public function continueAsNew(ContinueAsNewInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::getVersion() | ||
*/ | ||
public function getVersion(GetVersionInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::upsertSearchAttributes() | ||
*/ | ||
public function upsertSearchAttributes(UpsertSearchAttributesInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::await() | ||
*/ | ||
public function await(AwaitInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
|
||
/** | ||
* @see WorkflowOutboundCallsInterceptor::awaitWithTimeout() | ||
*/ | ||
public function awaitWithTimeout(AwaitWithTimeoutInput $input, callable $next): PromiseInterface | ||
{ | ||
return $next($input); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.