// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include namespace proton::feedtoken { class IState; } namespace proton { /** * Context class for document operations that acks operation when * instance is destroyed. Typically a shared pointer to an instance is * passed around to multiple worker threads that performs portions of * a larger task before dropping the shared pointer, triggering the * ack when all worker threads have completed. */ class OperationDoneContext : public vespalib::IDestructorCallback { public: OperationDoneContext(std::shared_ptr token, std::shared_ptr done_callback); ~OperationDoneContext() override; bool is_replay() const; private: std::shared_ptr _token; std::shared_ptr _done_callback; }; } // namespace proton