fix(api-gateway): type async service disposer
This commit is contained in:
@@ -11,6 +11,7 @@ import type {
|
|||||||
InvocationDescriptor,
|
InvocationDescriptor,
|
||||||
TypeRTClientApi,
|
TypeRTClientApi,
|
||||||
TypeRTCodec,
|
TypeRTCodec,
|
||||||
|
TypeRTDisposer,
|
||||||
TypeRTRemoteContribution,
|
TypeRTRemoteContribution,
|
||||||
} from '@deepseek-ai/dsh-type-meta'
|
} from '@deepseek-ai/dsh-type-meta'
|
||||||
|
|
||||||
@@ -291,7 +292,7 @@ class ScopedRemoteNamespace {
|
|||||||
private readonly ctx: Context
|
private readonly ctx: Context
|
||||||
private readonly ownerCtx: Context
|
private readonly ownerCtx: Context
|
||||||
private readonly methods = new Set<string>()
|
private readonly methods = new Set<string>()
|
||||||
private disposeService: (() => void) | undefined
|
private disposeService: TypeRTDisposer | undefined
|
||||||
readonly name: string
|
readonly name: string
|
||||||
|
|
||||||
static assertMethodAvailable(namespace: string, method: string): void {
|
static assertMethodAvailable(namespace: string, method: string): void {
|
||||||
@@ -348,7 +349,7 @@ class ScopedRemoteNamespace {
|
|||||||
if (this.methods.size !== 0) return
|
if (this.methods.size !== 0) return
|
||||||
const disposeService = this.disposeService
|
const disposeService = this.disposeService
|
||||||
this.disposeService = undefined
|
this.disposeService = undefined
|
||||||
disposeService?.()
|
void disposeService?.()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user