mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Make asynchronous celldb interface (#388)
* Asynchronous load_cell in celldb Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
ca00f0ed91
commit
845cbca1e5
5 changed files with 159 additions and 10 deletions
|
@ -33,8 +33,19 @@ namespace validator {
|
|||
class RootDb;
|
||||
|
||||
class CellDb;
|
||||
class CellDbAsyncExecutor;
|
||||
|
||||
class CellDbIn : public td::actor::Actor {
|
||||
class CellDbBase : public td::actor::Actor {
|
||||
public:
|
||||
virtual void start_up();
|
||||
protected:
|
||||
std::shared_ptr<vm::DynamicBagOfCellsDb::AsyncExecutor> async_executor;
|
||||
private:
|
||||
void execute_sync(std::function<void()> f);
|
||||
friend CellDbAsyncExecutor;
|
||||
};
|
||||
|
||||
class CellDbIn : public CellDbBase {
|
||||
public:
|
||||
using KeyHash = td::Bits256;
|
||||
|
||||
|
@ -89,7 +100,7 @@ class CellDbIn : public td::actor::Actor {
|
|||
KeyHash last_gc_;
|
||||
};
|
||||
|
||||
class CellDb : public td::actor::Actor {
|
||||
class CellDb : public CellDbBase {
|
||||
public:
|
||||
void load_cell(RootHash hash, td::Promise<td::Ref<vm::DataCell>> promise);
|
||||
void store_cell(BlockIdExt block_id, td::Ref<vm::Cell> cell, td::Promise<td::Ref<vm::DataCell>> promise);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue