mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Implement Storage::backend_opened and Storage::backend_lost events
This commit is contained in:
parent
a99a13dc4c
commit
cc7b2dc890
10 changed files with 117 additions and 15 deletions
|
@ -114,10 +114,15 @@ public:
|
|||
*/
|
||||
virtual void Poll() {}
|
||||
|
||||
const RecordValPtr& Options() const { return backend_options; }
|
||||
|
||||
protected:
|
||||
// Allow the manager to call Open/Close.
|
||||
friend class storage::Manager;
|
||||
|
||||
// Allow OpenResultCallback to call EnqueueConnectionEstablished.
|
||||
friend class storage::OpenResultCallback;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -183,10 +188,24 @@ protected:
|
|||
*/
|
||||
virtual void Expire() {}
|
||||
|
||||
/**
|
||||
* Enqueues the Storage::backend_opened event. This is called automatically
|
||||
* when an OpenResultCallback is completed successfully.
|
||||
*/
|
||||
void EnqueueBackendOpened();
|
||||
|
||||
/**
|
||||
* Enqueues the Storage::backend_lost event with an optional reason
|
||||
* string. This should be called by the backends whenever they lose their
|
||||
* connection.
|
||||
*/
|
||||
void EnqueueBackendLost(std::string_view reason);
|
||||
|
||||
void CompleteCallback(ResultCallback* cb, const OperationResult& data) const;
|
||||
|
||||
TypePtr key_type;
|
||||
TypePtr val_type;
|
||||
RecordValPtr backend_options;
|
||||
|
||||
std::string tag;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue