createIdZone method
The createIdZone
RPC is used to create a new ID zone where temporary IDs
for instances in the specified isolate may be allocated. See IDs and
Names
for more information about ID zones.
backingBufferKind | meaning |
---|---|
ring | Use a ring buffer to back the zone. |
idAssignmentPolicy | meaning |
---|---|
alwaysAllocate | When this ID zone is specified in an RPC invocation, |
InstancesRef and Instances within the response to that RPC will always |
|
have their id fields populated with newly allocated temporary IDs, even |
|
when there already exists an ID that refers to the same instance. | |
reuseExisting | When this ID zone is specified in an RPC invocation, |
InstancesRef and Instances within the response to that RPC will have |
|
their id fields populated with existing IDs when possible. This |
|
introduces an extra linear search of the zone – to check for existing IDs | |
– for each InstanceRef or Instance returned in a response. |
The capacity
parameter may be used to specify the maximum number of IDs
that the created zone will be able to hold at a time. If no argument for
capacity
is provided, the created zone will have the default capacity of
512 IDs.
When a VM Service client disconnects, all of the Service ID zones created by that client will be deleted. Because of this, Service ID zone IDs should not be shared between different clients.
Implementation
Future<IdZone> createIdZone(
String isolateId,
/*IdZoneBackingBufferKind*/ String backingBufferKind,
/*IdAssignmentPolicy*/ String idAssignmentPolicy, {
int? capacity,
}) =>
_call('createIdZone', {
'isolateId': isolateId,
'backingBufferKind': backingBufferKind,
'idAssignmentPolicy': idAssignmentPolicy,
if (capacity != null) 'capacity': capacity,
});