Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:isolate
  3. Isolate
  4. exit static method
exit
description

exit static method

Neverexit([
  1. SendPort?finalMessagePort,
  2. Object?message
])

Terminates the current isolate synchronously.

This operation is potentially dangerous and should be used judiciously.The isolate stops operatingimmediately. It throws if the optionalmessage does not adhere to the limitations on what can be sent from oneisolate to another (seeSendPort.send for more details). It also throwsif afinalMessagePort is associated with an isolate spawned outside ofcurrent isolate group, spawned viaspawnUri. Please refer toisolate groupfor more details about isolate groups.

If successful, a call to this method does not return. Pendingfinallyblocks are not executed, control flow will not go back to the event loop,scheduled asynchronous asks will never run, and even pending isolatecontrol commands may be ignored. (The isolate will send messages to portsalready registered usingIsolate.addOnExitListener, but no further Dartcode will run in the isolate.)

IffinalMessagePort is provided, and themessage can be sent throughit (seeSendPort.send for more details), then the message is sentthrough that port as the final operation of the current isolate. Theisolate terminates immediately after thatSendPort.send call returns.

If the port is a native port -- one provided byReceivePort.sendPort orRawReceivePort.sendPort -- the system may be able to send this finalmessage more efficiently than normal port communication between liveisolates. In these cases this final message object graph will bereassigned to the receiving isolate without copying. Further, thereceiving isolate will in most cases be able to receive the messagein constant time.

Implementation

external static Never exit([SendPort? finalMessagePort, Object? message]);
  1. Dart
  2. dart:isolate
  3. Isolate
  4. exit static method
Isolate class

[8]ページ先頭

©2009-2025 Movatter.jp