Skip to content

Commit 61bd04d

Browse files
committed
fix client
Signed-off-by: Robert Landers <landers.robert@gmail.com>
1 parent 0d9fc44 commit 61bd04d

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

cli/ext/build/ext.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,17 @@ func removeGoObject(handle C.uintptr_t) {
758758

759759
//export create_Worker_object
760760
func create_Worker_object() C.uintptr_t {
761-
obj := &Worker{}
761+
obj := &Worker{
762+
kind: "api",
763+
started: false,
764+
consumer: nil,
765+
activeId: nil,
766+
state: nil,
767+
pendingEvents: nil,
768+
authContext: nil,
769+
currentCtx: context.Background(),
770+
currentMsg: nil,
771+
}
762772
return registerGoObject(obj)
763773
}
764774

src/DurableClient.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ public function __construct(
4848

4949
public static function local(?Provenance $userContext = null): self
5050
{
51-
$entityClient = new LocalEntityClient(new SpyProxy(), new Worker());
52-
$orchestrationClient = new LocalOrchestrationClient(new SpyProxy(), new Worker());
51+
$worker = new Worker();
52+
$entityClient = new LocalEntityClient(new SpyProxy(), $worker);
53+
$orchestrationClient = new LocalOrchestrationClient(new SpyProxy(), $worker);
5354
$entityClient->withAuth($userContext);
5455
$orchestrationClient->withAuth($userContext);
5556

src/LocalOrchestrationClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function waitForCompletion(OrchestrationInstance $instance): void
141141
#[Override]
142142
public function withAuth(Provenance|string|null $token): void
143143
{
144-
$this->worker->setUser($token instanceof Provenance ? $token : null);
144+
$this->worker->setUser($token instanceof Provenance ? Serializer::serialize($token) : null);
145145
}
146146

147147
public function shareOrchestrationOwnership(OrchestrationInstance $id, string $with): void

0 commit comments

Comments
 (0)