Skip to content

Commit 0aa12f3

Browse files
committed
refactor(effect): rename actor transport to client
1 parent f3cddce commit 0aa12f3

3 files changed

Lines changed: 17 additions & 18 deletions

File tree

examples/effect/src/client.ts

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rivetkit-typescript/packages/effect/src/Actor.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ export interface RegistryShape {
8383
readonly _: unique symbol;
8484
}
8585

86-
export interface ActorTransportOptions {
86+
export interface ClientOptions {
8787
readonly endpoint: string;
8888
readonly token?: string;
8989
}
9090

91-
export interface ActorTransportShape extends ActorTransportOptions {
91+
export interface ClientShape extends ClientOptions {
9292
readonly _: unique symbol;
9393
}
9494

@@ -119,12 +119,11 @@ export class Registry extends Context.Service<Registry, RegistryShape>()(
119119
"@rivetkit/effect/Actor/Registry",
120120
) {}
121121

122-
export class ActorTransport extends Context.Service<
123-
ActorTransport,
124-
ActorTransportShape
125-
>()("@rivetkit/effect/Actor/ActorTransport") {
126-
static layer(options: ActorTransportOptions): Layer.Layer<ActorTransport> {
127-
return Layer.succeed(ActorTransport, {
122+
export class Client extends Context.Service<Client, ClientShape>()(
123+
"@rivetkit/effect/Client",
124+
) {
125+
static layer(options: ClientOptions): Layer.Layer<Client> {
126+
return Layer.succeed(Client, {
128127
...options,
129128
_: undefined as never,
130129
});
@@ -306,7 +305,7 @@ export interface Actor<
306305
readonly client: Effect.Effect<
307306
ActorClient<Actions, Messages, Events>,
308307
never,
309-
ActorTransport | ClientServices<Actor<Name, State, Actions, Messages, Events>>
308+
Client | ClientServices<Actor<Name, State, Actions, Messages, Events>>
310309
>;
311310

312311
of<Handlers extends ActionHandlers<Actions>>(handlers: Handlers): Handlers;
@@ -472,7 +471,7 @@ const Proto = {
472471
get client(): never {
473472
const self = this as unknown as AnyWithProps;
474473
throw new Error(
475-
`Actor.client for ${self._tag} is not yet implemented. ActorTransport runtime wiring is pending.`,
474+
`Actor.client for ${self._tag} is not yet implemented. Client runtime wiring is pending.`,
476475
);
477476
},
478477
annotate(this: AnyWithProps, tag: Context.Key<any, any>, value: any) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export * as Actor from "./Actor";
2-
export { ActorTransport, Registry } from "./Actor";
2+
export { Client, Registry } from "./Actor";
33
export * as Action from "./Action";
44
export * as Message from "./Message";

0 commit comments

Comments
 (0)