Import
import { Service } from "@typed/fx/Push";Signatures
export declare function Service<Self, A, E = never, B = never, E2 = never>(): <const Id extends string>(id: Id) => Push.Class<Self, Id, A, E, B, E2>;Why
A service gives a bidirectional application capability one stable identity, so producers and observers can depend on it through ordinary Effect requirements.
Ownership and lifetime
The returned Layer owns service installation and captures non-Scope services needed by both sides. Output runs retain the caller’s Scope and interruption; input acknowledgment Effects run in their caller. Layer release drops the service but does not invent cleanup beyond the supplied Sink and Fx.
Examples
import { Effect, Layer } from "effect"
import * as Fx from "@typed/fx/Fx"
import * as Push from "@typed/fx/Push"
import * as Sink from "@typed/fx/Sink"
class Messages extends Push.Service<Messages, string, never, string>()("Messages") {}
const MessagesLive = Messages.make(
Sink.make(() => Effect.void, (message) => Effect.log(message)),
Fx.succeed("ready")
)
const send = Messages.onSuccess("hello").pipe(Effect.provide(MessagesLive))Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.