MCPcopy Index your code
hub / github.com/Effect-TS/effect / fromRpcGroup

Function fromRpcGroup

packages/cluster/src/Entity.ts:365–381  ·  view source on GitHub ↗
(
  /**
   * The entity type name.
   */
  type: Type,
  /**
   * The schema definition for messages that the entity is capable of
   * processing.
   */
  protocol: RpcGroup.RpcGroup<Rpcs>
)

Source from the content-addressed store, hash-verified

363 * @category constructors
364 */
365export const fromRpcGroup = <const Type extends string, Rpcs extends Rpc.Any>(
366 /**
367 * The entity type name.
368 */
369 type: Type,
370 /**
371 * The schema definition for messages that the entity is capable of
372 * processing.
373 */
374 protocol: RpcGroup.RpcGroup<Rpcs>
375): Entity<Type, Rpcs> => {
376 const self = Object.create(Proto)
377 self.type = EntityType.make(type)
378 self.protocol = protocol
379 self.getShardGroup = Context.get(protocol.annotations, ShardGroup)
380 return self
381}
382
383/**
384 * Creates a new `Entity` of the specified `type` which will accept messages

Callers 5

annotateFunction · 0.85
annotateRpcsFunction · 0.85
annotateContextFunction · 0.85
annotateRpcsContextFunction · 0.85
makeFunction · 0.85

Calls 3

createMethod · 0.80
makeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected