FilePersistor class
A worker abstraction that creates a background worker isolate to process file persistence/hydration.
Constructors
-
FilePersistor({Duration persistenceThrottle = const Duration(milliseconds: 100), PersistorSettings settings = const FilePersistorSettings(), void onPersist(List<
Document> batch)?, void onClear(String collection)?, void onClearAll()?, void onHydrate(SerializedCollectionStore data)?})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onClear → void Function(String collection)?
-
finalinherited
- onClearAll → void Function()?
-
finalinherited
- onHydrate → void Function(SerializedCollectionStore data)?
-
finalinherited
-
onPersist
→ void Function(List<
Document> batch)? -
finalinherited
- persistenceThrottle → Duration
-
finalinherited
- receivePort ↔ ReceivePort
-
This persistor's receive port
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secureStorageKey → String
-
final
- sendPort ↔ SendPort
-
The worker's send port
latefinal
- settings → PersistorSettings
-
finalinherited
Methods
-
clear(
String collection) → Future< void> -
override
-
clearAll(
) → Future< void> -
override
-
hydrate(
) → Future< SerializedCollectionStore> -
override
-
init(
) → Future< void> -
Public APIs to be implemented by any Persistor extension like FilePersistor.
override
-
initDirectory(
) → Future< Directory> - Initializes the directory in which files are persisted. This needs to be done on the main isolate as opposed to the worker since it requires access to plugins that are not easily available in the worker isolate context.
-
initEncrypter(
) → Future< Encrypter?> - Initializes the encrypter used for encrypting files. This needs to be done on the main isolate as opposed to the worker since it requires access to plugins that are not easily available in the worker isolate context.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
persist(
List< Document> docs) → Future<void> -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited