Skip to content

Commit 9f33323

Browse files
committed
update disposebag
1 parent 66c0219 commit 9f33323

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

lib/src/async/async_queue.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ class AsyncQueue<T> {
2626

2727
final _blockS = StreamController<_AsyncQueueEntry<T>>();
2828
final _countS = StreamController<int>();
29-
late final _bag =
30-
DisposeBag(const <Object>[], 'AsyncQueue#${shortHash(this)}');
29+
late final DisposeBag _bag;
3130

3231
/// Construct [AsyncQueue].
33-
AsyncQueue(void Function() onTimeout) {
32+
AsyncQueue(Object key, void Function() onTimeout) {
33+
_bag = DisposeBag(
34+
const <Object>[], '( AsyncQueue ~ $key ~ ${shortHash(this)} )');
35+
3436
_blockS.disposedBy(_bag);
3537
_countS.disposedBy(_bag);
3638

lib/src/impl/real_storage.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class RealRxStorage<Key extends Object, Options,
3030

3131
final _disposeMemo = AsyncMemoizer<void>();
3232
late final _bag =
33-
DisposeBag(const <Object>[], 'RealRxStorage#${shortHash(this)}');
33+
DisposeBag(const <Object>[], '( RealRxStorage ~ ${shortHash(this)} )');
3434

3535
/// Logger controller. Nullable
3636
StreamController<LoggerEvent<Key, Options>>? _loggerEventController;
@@ -114,7 +114,9 @@ class RealRxStorage<Key extends Object, Options,
114114
.putIfAbsent(
115115
key,
116116
() => AsyncQueue<Object?>(
117-
() => _writeQueueResources.remove(key)?.dispose()),
117+
key,
118+
() => _writeQueueResources.remove(key)?.dispose(),
119+
),
118120
)
119121
.enqueue(block)
120122
.then((value) => value as T);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ dependencies:
1717

1818
dev_dependencies:
1919
pedantic: ^1.11.0
20-
test: ^1.16.8
20+
test: ^1.17.1
2121
collection: ^1.15.0

0 commit comments

Comments
 (0)