API
Transportโ
Transport is the main entry point to configure IO.
tip
You could call the shutdown
method if you want to close all IO workers
Declaration
class Transport {
Transport({String? libraryPath})
Future<void> shutdown({Duration? gracefulTimeout}) async
SendPort worker(TransportWorkerConfiguration configuration)
Example
final transport = Transport();
final worker = TransportWorker(transport.worker(TransportDefaults.worker()));
await worker.initialize();
/* Do some work */
/* Handle stop on your own */
await transport.shutdown();
Methodsโ
shutdownโ
Stops all workers and destroys transport objects.
workerโ
Creates a new SendPort which could be used to create a new TransportWorker
.