Split sync/async handling into the BIF methods

This commit is contained in:
Tim Wojtulewicz 2025-02-19 14:58:59 -07:00
parent c247de8ec3
commit e766af7322
8 changed files with 260 additions and 181 deletions

View file

@ -13,7 +13,7 @@ struct redisPollEvents;
namespace zeek::storage::backend::redis {
class Redis : public Backend, public iosource::IOSource {
public:
Redis(std::string_view tag) : Backend(true, tag), IOSource(true) {}
Redis(std::string_view tag) : Backend(SupportedModes::ASYNC, tag), IOSource(true) {}
~Redis() override = default;
static BackendPtr Instantiate(std::string_view tag);
@ -81,9 +81,11 @@ public:
// themselves from the list of active operations.
void HandleGeneric() { --active_ops; }
protected:
void Poll() override;
private:
ValResult ParseGetReply(redisReply* reply) const;
void Poll();
redisAsyncContext* async_ctx = nullptr;