20#ifndef RIPPLE_APP_MISC_DETAIL_WORKFILE_H_INCLUDED
21#define RIPPLE_APP_MISC_DETAIL_WORKFILE_H_INCLUDED
23#include <xrpld/app/misc/detail/Work.h>
25#include <xrpl/basics/ByteUtilities.h>
26#include <xrpl/basics/FileUtilities.h>
27#include <xrpl/beast/utility/instrumentation.h>
29#include <boost/asio/bind_executor.hpp>
30#include <boost/asio/io_context.hpp>
31#include <boost/asio/strand.hpp>
52 boost::asio::io_context& ios,
65 boost::asio::io_context&
ios_;
66 boost::asio::strand<boost::asio::io_context::executor_type>
strand_;
73 boost::asio::io_context& ios,
78 , strand_(
boost::asio::make_strand(ios))
91 if (!
strand_.running_in_this_thread())
92 return boost::asio::post(
94 boost::asio::bind_executor(
100 XRPL_ASSERT(
cb_,
"ripple::detail::WorkFile::run : callback is set");
101 cb_(ec, fileContents);
boost::system::error_code error_code
WorkFile(std::string const &path, boost::asio::io_context &ios, callback_type cb)
boost::asio::strand< boost::asio::io_context::executor_type > strand_
boost::asio::io_context & ios_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr auto megabytes(T value) noexcept
std::error_code make_error_code(ripple::TokenCodecErrc e)
std::string getFileContents(boost::system::error_code &ec, boost::filesystem::path const &sourcePath, std::optional< std::size_t > maxSize=std::nullopt)
T shared_from_this(T... args)