addToBuilderAsBlocking static method
void
addToBuilderAsBlocking(})
Adds the implementation of the NSDiscardableContent protocol to an existing
objc.ObjCProtocolBuilder. All methods that can be implemented as blocking
listeners will be.
Note: You cannot call this method after you have called builder.build.
Implementation
static void addToBuilderAsBlocking(
objc.ObjCProtocolBuilder builder, {
required bool Function() beginContentAccess,
required void Function() endContentAccess,
required void Function() discardContentIfPossible,
required bool Function() isContentDiscarded,
bool $keepIsolateAlive = true,
}) {
NSDiscardableContent.beginContentAccess.implement(
builder,
beginContentAccess,
);
NSDiscardableContent.endContentAccess.implementAsBlocking(
builder,
endContentAccess,
);
NSDiscardableContent.discardContentIfPossible.implementAsBlocking(
builder,
discardContentIfPossible,
);
NSDiscardableContent.isContentDiscarded.implement(
builder,
isContentDiscarded,
);
builder.addProtocol($protocol);
}