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

Method split

packages/effect/src/eventlog/EventLogMessage.ts:220–233  ·  view source on GitHub ↗

* Splits binary event-log message data into numbered chunks. * * @stability unstable * @since 4.0.0

(id: number, data: Uint8Array)

Source from the content-addressed store, hash-verified

218 * @since 4.0.0
219 */
220 static split(id: number, data: Uint8Array): NonEmptyReadonlyArray<ChunkedMessage> {
221 const parts = Math.max(1, Math.ceil(data.byteLength / ChunkedMessage.chunkSize))
222 const result: NonEmptyArray<ChunkedMessage> = new Array(parts) as any
223 for (let i = 0; i < parts; i++) {
224 const start = i * ChunkedMessage.chunkSize
225 const end = Math.min((i + 1) * ChunkedMessage.chunkSize, data.byteLength)
226 result[i] = new ChunkedMessage({
227 id,
228 part: [i, parts],
229 data: data.subarray(start, end) as any
230 })
231 }
232 return result
233 }
234
235 /**
236 * Reassembles all chunks for a message id into the original binary payload.

Callers 15

matchesFunction · 0.45
findAnnotationFunction · 0.45
isInternalModuleFunction · 0.45
Codegen.tsFile · 0.45
Plugin.test.tsFile · 0.45
parseDiagnosticsFunction · 0.45
findEndpointFunction · 0.45
expandMoveFunction · 0.45
Utils.tsFile · 0.45
resolveRefFunction · 0.45
normalizeMediaTypeFunction · 0.45

Calls

no outgoing calls

Tested by 15

parseDiagnosticsFunction · 0.36
findEndpointFunction · 0.36
entityFunction · 0.36
execMethod · 0.36
startupParametersFunction · 0.36
writeFunction · 0.36
decodeFunction · 0.36
makeConnectorFunction · 0.36
verifySigV4Function · 0.36
pathFromSequenceFunction · 0.36
parseTerrainFunction · 0.36
splitsFunction · 0.36