Methods
Methods describe request-response calls in a protocol.
External methods are callable by connected clients. Internal methods are callable between Durable Object instances through a namespace handle.
Define a shared method
import { as } from "effect"
export const = {
: .({
: .,
}),
: .({
: .,
: .,
}),
: .,
}Shared methods such as UpdateProfile or ReportUser can live under a common
shared/methods directory and be inserted into a client's external table or a
namespace's internal table.
Implement a shared handler
If a method is shared, its handler can be shared too.
export default (
,
.(function* ({ , }) {
// shared logic here
return { : true }
}),
)Internal and external handlers are supplied to ActorRuntime.make(...) in the
corresponding method table.