-
|
I am using Drift to store log entries. Based on documentation: https://drift.simonbinder.eu/isolates/#simple-sharing I am trying to pass: Like this: final Map<String, Object> params = {}
params["loggerConnection"] = db.serializableConnection()
final result = await compute(function, params);but I get the: I was hoping to use it inside of the final connection = args["loggerConnection"] as DriftIsolate;
final executor = await connection.connect();
final driftDatabase = AppDatabaseDrift(executor);Any hint would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
That's exactly how params["loggerConnection"] = await db.serializableConnection()The future itself can't be shared across isolates, but the returned |
Beta Was this translation helpful? Give feedback.
That's exactly how
serializableConnection()is supposed to be used. The only problem is that it returns aFuture, so you need to use:The future itself can't be shared across isolates, but the returned
DriftIsolatecan.