Exemplo n.º 1
0
 def _from_store(cls,
         store: Store,
         config: StoreConfigMapInitializer = None
         ) -> 'Bus':
     return cls(cls._deferred_series(store.labels()),
             store=store,
             config=config
             )
Exemplo n.º 2
0
 def _from_store(
     cls,
     store: Store,
     config: StoreConfigMapInitializer = None,
 ) -> 'Batch':
     config_map = StoreConfigMap.from_initializer(config)
     items = ((label, store.read(label, config=config_map[label]))
              for label in store.labels())
     return cls(items, config=config)
Exemplo n.º 3
0
 def _from_store(
         cls,
         store: Store,
         config: StoreConfigMapInitializer = None,
         max_persist: tp.Optional[int] = None,  # not used
 ) -> 'Batch':
     config_map = StoreConfigMap.from_initializer(config)
     items = ((label, store.read(label, config=config_map[label]))
              for label in store.labels())
     return cls(items, config=config)
Exemplo n.º 4
0
 def _from_store(cls,
         store: Store,
         *,
         config: StoreConfigMapInitializer = None,
         max_persist: tp.Optional[int],
         ) -> 'Bus':
     return cls(cls._deferred_series(store.labels()),
             store=store,
             config=config,
             max_persist=max_persist,
             )
Exemplo n.º 5
0
 def _from_store(cls,
         store: Store,
         *,
         config: StoreConfigMapInitializer = None,
         max_persist: tp.Optional[int] = None,
         index_constructor: IndexConstructor = None,
         ) -> 'Bus':
     return cls(cls._deferred_series(
                     store.labels(config=config),
                     index_constructor=index_constructor,
                     ),
             store=store,
             config=config,
             max_persist=max_persist,
             own_data=True,
             )
Exemplo n.º 6
0
 def _from_store(
     cls,
     store: Store,
     *,
     config: StoreConfigMapInitializer = None,
     max_persist: tp.Optional[int] = None,
     index_constructor: IndexConstructor = None,
 ) -> 'Bus':
     return cls(
         None,  # will generate FrameDeferred array
         index=store.labels(config=config),
         index_constructor=index_constructor,
         store=store,
         config=config,
         max_persist=max_persist,
         own_data=True,
     )
Exemplo n.º 7
0
    def _from_store(
        cls,
        store: Store,
        *,
        config: StoreConfigMapInitializer = None,
        max_workers: tp.Optional[int] = None,
        chunksize: int = 1,
        use_threads: bool = False,
    ) -> 'Batch':
        config_map = StoreConfigMap.from_initializer(config)

        items = ((label, store.read(label, config=config_map[label]))
                 for label in store.labels(config=config_map))

        return cls(
            items,
            config=config,
            max_workers=max_workers,
            chunksize=chunksize,
            use_threads=use_threads,
        )