MCPcopy Create free account
hub / github.com/effect-app/libs / fromRpcGroup

Function fromRpcGroup

repos/effect/packages/effect/src/unstable/cluster/Entity.ts:405–421  ·  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

403/**
404 * Creates a new `Entity` of the specified `type` which will accept messages
405 * that adhere to the provided `RpcGroup`.
406 *
407 * @category constructors
408 * @since 4.0.0
409 */
410export const fromRpcGroup = <const Type extends string, Rpcs extends Rpc.Any>(
411 /**
412 * The entity type name.
413 */
414 type: Type,
415 /**
416 * The schema definition for messages that the entity is capable of
417 * processing.
418 */
419 protocol: RpcGroup.RpcGroup<Rpcs>
420): Entity<Type, Rpcs> => {
421 const self = Object.create(Proto)
422 self.type = EntityType.make(type)
423 self.protocol = protocol
424 self.getShardGroup = Context.get(protocol.annotations, ShardGroup)

Callers 5

annotateFunction · 0.85
annotateRpcsFunction · 0.85
annotateMergeFunction · 0.85
annotateRpcsMergeFunction · 0.85
makeFunction · 0.85

Calls 2

makeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…