Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme #540

Merged
merged 8 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix phpdoc
  • Loading branch information
roxblnfk committed Dec 19, 2024
commit 021bff7e697ed21240fa2e21fb81afe221403e0d
4 changes: 0 additions & 4 deletions src/Activity/ActivityContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,20 @@ interface ActivityContextInterface
* Returns information about current activity execution.
*
* @see Activity::getInfo()
*
*/
public function getInfo(): ActivityInfo;

/**
* Returns activity execution input arguments.
*
* @see Activity::getInput()
*
*/
public function getInput(): ValuesInterface;

/**
* Check if the heartbeat's first argument has been passed.
*
* @see Activity::hasHeartbeatDetails()
*
*/
public function hasHeartbeatDetails(): bool;

Expand All @@ -55,7 +52,6 @@ public function getHeartbeatDetails($type = null);
* Marks the activity as incomplete for asynchronous completion.
*
* @see Activity::doNotCompleteOnReturn()
*
*/
public function doNotCompleteOnReturn(): void;

Expand Down
8 changes: 0 additions & 8 deletions src/Activity/ActivityInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ final class ActivityInfo
* A correlation token that can be used to complete the activity through `complete` method.
*
* @see ActivityCompletionClientInterface::complete()
*
*/
#[Marshal(name: 'TaskToken')]
public string $taskToken;
Expand All @@ -56,14 +55,12 @@ final class ActivityInfo
* activity through `complete` method.
*
* @see ActivityCompletionClientInterface::complete()
*
*/
#[Marshal(name: 'ActivityID')]
public string $id;

/**
* Type (name) of the activity.
*
*/
#[Marshal(name: 'ActivityType', type: ObjectType::class, of: ActivityType::class)]
public ActivityType $type;
Expand All @@ -73,36 +70,31 @@ final class ActivityInfo

/**
* Maximum time between heartbeats. 0 means no heartbeat needed.
*
*/
#[Marshal(name: 'HeartbeatTimeout', type: DateIntervalType::class)]
public \DateInterval $heartbeatTimeout;

/**
* Time of activity scheduled by a workflow
*
*/
#[Marshal(name: 'ScheduledTime', type: DateTimeType::class)]
public \DateTimeInterface $scheduledTime;

/**
* Time of activity start
*
*/
#[Marshal(name: 'StartedTime', type: DateTimeType::class)]
public \DateTimeInterface $startedTime;

/**
* Time of activity timeout
*
*/
#[Marshal(name: 'Deadline', type: DateTimeType::class)]
public \DateTimeInterface $deadline;

/**
* Attempt starts from 1, and increased by 1 for every retry if
* retry policy is specified.
*
*/
#[Marshal(name: 'Attempt')]
public int $attempt = 1;
Expand Down
1 change: 0 additions & 1 deletion src/Client/Common/RpcRetryOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public function withCongestionInitialInterval($interval): self
*
* @param null|float $coefficient Maximum amount of jitter.
* Default will be used if set to {@see null}.
*
*/
#[Pure]
public function withMaximumJitterCoefficient(?float $coefficient): self
Expand Down
1 change: 0 additions & 1 deletion src/Client/GRPC/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public function close(): void

/**
* @param null|Pipeline<GrpcClientInterceptor, object> $pipeline
*
*/
final public function withInterceptorPipeline(?Pipeline $pipeline): static
{
Expand Down
1 change: 0 additions & 1 deletion src/Client/Update/UpdateHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public function getId(): string

/**
* Check there is a cached accepted result or failure for this update request.
*
*/
public function hasResult(): bool
{
Expand Down
42 changes: 37 additions & 5 deletions src/Client/WorkflowClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,16 @@ public static function create(
return new self($serviceClient, $options, $converter, $interceptorProvider);
}

/**
* @inheritDoc
*/
public function getServiceClient(): ServiceClientInterface
{
return $this->client;
}

/**
* Starts workflow in async mode. Returns WorkflowRun object which can be used to wait for the execution result.
* WorkflowRun objects created by typed workflow stubs will attempt to type the execution result as well.
*
* @param object|WorkflowStubInterface $workflow
* @param mixed ...$args
* @inheritDoc
*/
public function start($workflow, ...$args): WorkflowRunInterface
{
Expand Down Expand Up @@ -148,6 +147,9 @@ public function start($workflow, ...$args): WorkflowRunInterface
);
}

/**
* @inheritDoc
*/
public function signalWithStart(
$workflow,
string $signal,
Expand Down Expand Up @@ -206,6 +208,9 @@ public function signalWithStart(
);
}

/**
* @inheritDoc
*/
#[Deprecated(replacement: '%class%->signalWithStart(%parametersList%)')]
public function startWithSignal(
$workflow,
Expand All @@ -216,6 +221,9 @@ public function startWithSignal(
return $this->signalWithStart($workflow, $signal, $signalArgs, $startArgs);
}

/**
* @inheritDoc
*/
public function updateWithStart(
$workflow,
string|UpdateOptions $update,
Expand Down Expand Up @@ -250,6 +258,9 @@ public function updateWithStart(
: $handle;
}

/**
* @inheritDoc
*/
public function newWorkflowStub(
string $class,
?WorkflowOptions $options = null,
Expand All @@ -263,6 +274,9 @@ public function newWorkflowStub(
);
}

/**
* @inheritDoc
*/
public function newUntypedWorkflowStub(
string $workflowType,
?WorkflowOptions $options = null,
Expand All @@ -279,6 +293,9 @@ public function newUntypedWorkflowStub(
);
}

/**
* @inheritDoc
*/
public function newRunningWorkflowStub(string $class, string $workflowID, ?string $runID = null): object
{
$workflow = $this->reader->fromClass($class);
Expand All @@ -290,6 +307,9 @@ public function newRunningWorkflowStub(string $class, string $workflowID, ?strin
);
}

/**
* @inheritDoc
*/
public function newUntypedRunningWorkflowStub(
string $workflowID,
?string $runID = null,
Expand All @@ -307,11 +327,17 @@ public function newUntypedRunningWorkflowStub(
return $untyped;
}

/**
* @inheritDoc
*/
public function newActivityCompletionClient(): ActivityCompletionClientInterface
{
return new ActivityCompletionClient($this->client, $this->clientOptions, $this->converter);
}

/**
* @inheritDoc
*/
public function listWorkflowExecutions(
string $query,
?string $namespace = null,
Expand Down Expand Up @@ -348,6 +374,9 @@ public function listWorkflowExecutions(
return Paginator::createFromGenerator($loader($request), $counter);
}

/**
* @inheritDoc
*/
public function countWorkflowExecutions(
string $query,
?string $namespace = null,
Expand All @@ -363,6 +392,9 @@ public function countWorkflowExecutions(
);
}

/**
* @inheritDoc
*/
public function getWorkflowHistory(
WorkflowExecution $execution,
?string $namespace = null,
Expand Down
11 changes: 5 additions & 6 deletions src/Client/WorkflowClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ interface WorkflowClientInterface extends ClientContextInterface
public function getServiceClient(): ServiceClientInterface;

/**
* Starts untyped and typed workflow stubs in async mode.
* Starts workflow in async mode.
*
* Returns WorkflowRun object which can be used to wait for the execution result.
* WorkflowRun objects created by typed workflow stubs will attempt to type the execution result as well.
*
* @param WorkflowStubInterface|object $workflow
* @param mixed $args
* @param mixed ...$args
*/
public function start($workflow, ...$args): WorkflowRunInterface;

Expand Down Expand Up @@ -111,7 +114,6 @@ public function newWorkflowStub(
*
* IMPORTANT! Stub is per workflow instance. So new stub should be created
* for each new one.
*
*/
public function newUntypedWorkflowStub(
string $workflowType,
Expand All @@ -133,7 +135,6 @@ public function newRunningWorkflowStub(

/**
* Returns untyped workflow stub associated with running workflow.
*
*/
public function newUntypedRunningWorkflowStub(
string $workflowID,
Expand All @@ -148,7 +149,6 @@ public function newUntypedRunningWorkflowStub(
* Only relevant for activity implementations that called {@see ActivityContext::doNotCompleteOnReturn()}.
*
* @see ActivityCompletionClient
*
*/
public function newActivityCompletionClient(): ActivityCompletionClientInterface;

Expand Down Expand Up @@ -203,7 +203,6 @@ public function countWorkflowExecutions(
* Available values are {@see HistoryEventFilterType} constants.
* @param int<0, max> $pageSize Size of the pages to be requested. It affects internal queries only. Use it if you
* want to load limited number of events from the history.
*
*/
public function getWorkflowHistory(
WorkflowExecution $execution,
Expand Down
5 changes: 0 additions & 5 deletions src/Client/WorkflowStubInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function getWorkflowType(): ?string;
/**
* Returns associated workflow options. Empty for running workflows. Workflow options are immutable and can
* not be changed after the workflow was created.
*
*/
public function getOptions(): ?WorkflowOptions;

Expand All @@ -53,13 +52,11 @@ public function getExecution(): WorkflowExecution;

/**
* Check if workflow was started and has associated execution.
*
*/
public function hasExecution(): bool;

/**
* Attaches running workflow context to the workflow stub.
*
*/
public function setExecution(WorkflowExecution $execution): void;

Expand Down Expand Up @@ -122,7 +119,6 @@ public function getUpdateHandle(string $updateId, mixed $resultType = null): Upd
* Cancellation cancels {@see CancellationScopeInterface} that wraps the
* main workflow method. Note that workflow can take long time to get
* canceled or even completely ignore the cancellation request.
*
*/
public function cancel(): void;

Expand All @@ -131,7 +127,6 @@ public function cancel(): void;
*
* Termination is a hard stop of a workflow execution which doesn't give
* workflow code any chance to perform cleanup.
*
*/
public function terminate(string $reason, array $details = []): void;
}
1 change: 0 additions & 1 deletion src/Common/CronSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ final class CronSchedule implements \Stringable
* │ │ │ │ │
* * * * * *
* ```
*
*/
#[Immutable]
public string $interval;
Expand Down
2 changes: 0 additions & 2 deletions src/DataConverter/EncodedValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public static function sliceValues(
* Decode promise response upon returning it to the domain layer.
*
* @param string|\ReflectionClass|\ReflectionType|Type|null $type
*
*/
public static function decodePromise(PromiseInterface $promise, $type = null): PromiseInterface
{
Expand All @@ -101,7 +100,6 @@ public static function fromValues(array $values, ?DataConverterInterface $dataCo

/**
* @param TPayloadsCollection $payloads
*
*/
public static function fromPayloadCollection(
\Traversable $payloads,
Expand Down
1 change: 0 additions & 1 deletion src/DataConverter/PayloadConverterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ interface PayloadConverterInterface
{
/**
* Returns associated encoding type.
*
*/
public function getEncodingType(): string;

Expand Down
2 changes: 0 additions & 2 deletions src/DataConverter/ValuesInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ interface ValuesInterface extends \Countable
{
/**
* Checks if any value present.
*
*/
public function isEmpty(): bool;

Expand All @@ -41,7 +40,6 @@ public function getValue(int $index, $type);

/**
* Returns associated payloads.
*
*/
public function toPayloads(): Payloads;
}
1 change: 0 additions & 1 deletion src/Exception/Failure/TemporalFailure.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public function __toString(): string

/**
* Explain known types of key=>value pairs.
*
*/
protected static function buildMessage(array $values): string
{
Expand Down
1 change: 0 additions & 1 deletion src/Interceptor/ActivityInboundInterceptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ interface ActivityInboundInterceptor extends Interceptor
* Intercepts a call to the main activity entry method.
*
* @param callable(ActivityInput): mixed $next
*
*/
public function handleActivityInbound(ActivityInput $input, callable $next): mixed;
}
Loading
Loading