SendPort and ReceivePort

As pointed out before, the message passed to the compute() function and the return value from it must respect some limitations. Those limitations come from the isolates communication layer. Isolates, as said before, communicate with each other through the messages. These messages are sent and received through SendPort and ReceivePort instances. 

To send a message to an isolate port, we first need to obtain a ReceivePort instance corresponding to it. The ReceivePort class exposes a sendPort getter that is bounded to the isolate, so we can send messages to it. How does an isolate get ReceivePort from another isolate? It does so through the IsolateNameServer class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.131.238