combine library
A Flutter package which allows you to work with MethodChannels in Isolate and provides simplified Isolate and Thread Pool API.
Classes
- Combine
- Combine is used to spawn a new CombineIsolate.
- CombineInfo
- CombineIsolate
-
CombineIsolate is a representation of
Isolate
in which you can use platform channels. So when you create a CombineIsolateIsolate
will be created under the hood except web platform. - CombineWorker
- Combine Worker is a pool of CombineIsolates that efficiently executes tasks in them. It is primarily used to reduce the number of isolates and provide more performant and easy way to execute tasks.
- CombineWorkerImpl
- CombineWorkerManager
- CombineWorkerManagerFactory
-
ExecutableTask<
T> - IsolateContext
-
IsolateContext holds an argument, passed while you spawn
Isolate
, IsolateMessenger which is used to communicate with originalIsolate
and CombineIsolate which is represents currentIsolate
. - IsolateFactory
-
It is used to create
Isolate
and setup all necessary stuff which is needed to use method channels. - IsolateMessenger
-
IsolateMessenger is used to chat with
Isolate
. It has messages getter with stream of messages fromIsolate
and send method which sends message toIsolate
. - NativeIsolateFactory
- It is used to create Isolate and setup all necessary stuff which is needed to use method channels.
- NativeWorkerManager
- NativeWorkerManagerFactory
-
NoArgsTask<
T> -
TaskErrorResponse<
T> -
TaskInfo<
T> -
TaskResponse<
T> -
TaskValueResponse<
T> -
TaskWith2Args<
T, Q, C> -
TaskWith3Args<
T, Q, C, A> -
TaskWith4Args<
T, Q, C, A, B> -
TaskWith5Args<
T, Q, C, A, B, D> -
TaskWithApplyArgs<
T> -
TaskWithArg<
T, Q> - WebWorkerManager
Constants
- defaultIsolatePrefix → const String
- defaultTasksPerIsolate → const int
Properties
- effectiveIsolateFactory → IsolateFactory
-
Returns test isolate factory or it's implementation depending on the platform.
no setter
- effectiveWorkerFactory → CombineWorkerManagerFactory
-
no setter
- testIsolatesCount → int?
-
no setter
Functions
-
cleanTestIsolateFactory(
) → void -
clearTestIsolatesCount(
) → void -
clearWorkerFactory(
) → void -
getRootIsolateToken(
{required bool isWeb}) → RootIsolateToken? -
setTestIsolateFactory(
IsolateFactory isolateFactory) → void -
setTestIsolatesCount(
int count) → void -
setTestWorkerFactory(
CombineWorkerManagerFactory factory) → void
Typedefs
-
IsolateEntryPoint<
T> = FutureOr< void> Function(IsolateContext context) - Typedef for a function which will be called in Isolate.
-
Task<
T> = FutureOr< T> Function() -
Task1<
T, Q> = FutureOr< T> Function(Q argument) -
Task2<
T, Q, C> = FutureOr< T> Function(Q argument1, C argument2) -
Task3<
T, Q, C, A> = FutureOr< T> Function(Q argument1, C argument2, A argument3) -
Task4<
T, Q, C, A, B> = FutureOr< T> Function(Q argument1, C argument2, A argument3, B argument4) -
Task5<
T, Q, C, A, B, D> = FutureOr< T> Function(Q argument1, C argument2, A argument3, B argument4, D argument5) -
TaskApply<
T> = Function -
WorkerInitializer
= FutureOr<
void> Function() - Typedef for the function that will be executed in the each worker isolate.
Exceptions / Errors
- CombineWorkerClosedException
- UnsupportedIsolateArgumentError
-
This exception is thrown when when you send to/from isolate some unsupported data like
ReceivePort
.