composeResource static method

DC composeResource(
  1. IResource resource,
  2. DistributedConnection connection
)
Compose a resource Resource to compose. DistributedConnection is required to check locality.

Implementation

static DC composeResource(
    IResource resource, DistributedConnection connection) {
  if (isLocalResource(resource, connection))
    return DC.uint32ToBytes((resource as DistributedResource).id as int);
  else {
    return (BinaryList()
          ..addGuid(resource.instance?.template.classId as Guid)
          ..addUint32(resource.instance?.id as int))
        .toDC();
  }
}