MCPcopy Create free account
hub / github.com/Effect-TS/effect / resumeEntityFromStorage

Function resumeEntityFromStorage

packages/cluster/src/Sharding.ts:810–822  ·  view source on GitHub ↗
(lastReceivedMessage: Message.IncomingRequest<any>)

Source from the content-addressed store, hash-verified

808 interrupts: Map<Snowflake.Snowflake, Message.IncomingEnvelope>
809 }>()
810 const resumeEntityFromStorage = (lastReceivedMessage: Message.IncomingRequest<any>) => {
811 const address = lastReceivedMessage.envelope.address
812 const resumptionState = MutableHashMap.get(entityResumptionState, address)
813 if (Option.isSome(resumptionState)) {
814 resumptionState.value.unprocessed.add(lastReceivedMessage.envelope.requestId)
815 return Effect.void
816 }
817 MutableHashMap.set(entityResumptionState, address, {
818 unprocessed: new Set([lastReceivedMessage.envelope.requestId]),
819 interrupts: new Map()
820 })
821 return resumeEntityFromStorageImpl(address)
822 }
823 const resumeEntityFromStorageImpl = Effect.fnUntraced(
824 function*(address: EntityAddress) {
825 const state = entityManagers.get(address.entityType)

Callers 1

Sharding.tsFile · 0.85

Calls 3

getMethod · 0.65
addMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected