Skip to content

callback missing when use Future.wait #42

@himulawang

Description

@himulawang
IRedisHandlerPool redisPool = new IRedisHandlerPool();

  redisPool.init(store['redis'])
  .then((_) {
    List waitList = [];
    User user = new User()..setPK(1);
    RedisClient handler = new IRedisHandlerPool().getReaderHandler(UserRedisStore.store, user);
    /*
    waitList..add(UserRedisStore.get(1, 'u:1'))
            ..add(UserRedisStore.get(2, 'u:1'));
            */
    waitList
      ..add(handler.hmget('u:1:1', user.getMapAbb().keys).then((_) => print(1)))
      ..add(handler.hmget('u:1:2', user.getMapAbb().keys).then((_) => print(2)))
      ..add(handler.hmget('u:1:3', user.getMapAbb().keys).then((_) => print(3)))
      ..add(handler.hmget('u:1:4', user.getMapAbb().keys).then((_) => print(4)))
      ..add(handler.hmget('u:1:5', user.getMapAbb().keys).then((_) => print(5)))
    ;

    return Future.wait(waitList);
  })
  .then((List list) => print(list));

output

/home/ila/ide/dart/dart-sdk/bin/dart --ignore-unrecognized-flags --debug:43375 --package-root=/home/ila/project/i_dart/packages/ /home/ila/project/i_dart/test/test.dart
Redis connected.
1
2

callback from 3 to 5 was not called

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions