LeviLamina
Loading...
Searching...
No Matches
RetryPolicy.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7namespace Bedrock::Http { class Response; }
8// clang-format on
9
10namespace Bedrock::Http {
11
12class RetryPolicy {
13public:
14 // member variables
15 // NOLINTBEGIN
17 // NOLINTEND
18
19public:
20 // prevent constructor by default
21 RetryPolicy& operator=(RetryPolicy const&);
22 RetryPolicy(RetryPolicy const&);
23 RetryPolicy();
24
25public:
26 // member functions
27 // NOLINTBEGIN
28 MCNAPI explicit RetryPolicy(
29 ::std::function<::std::optional<::std::chrono::seconds>(::Bedrock::Http::Response const&)>&& implementation
30 );
31
32 MCNAPI ::std::optional<::std::chrono::seconds> getDelay(::Bedrock::Http::Response const& response) const;
33 // NOLINTEND
34
35public:
36 // static functions
37 // NOLINTBEGIN
38 MCNAPI static ::std::function<::std::optional<::std::chrono::seconds>(::Bedrock::Http::Response const&)>
39 Always(::std::chrono::seconds delay);
40
41 MCNAPI static ::std::function<::std::optional<::std::chrono::seconds>(::Bedrock::Http::Response const&)> Chained(
42 ::std::initializer_list<
43 ::std::function<::std::optional<::std::chrono::seconds>(::Bedrock::Http::Response const&)>>&& retryChain
44 );
45
46#ifdef LL_PLAT_C
47 MCNAPI static ::std::function<::std::optional<::std::chrono::seconds>(::Bedrock::Http::Response const&)>
48 Count(int attempts, ::std::chrono::seconds retryDelay);
49#endif
50
51 MCNAPI static ::std::function<::std::optional<::std::chrono::seconds>(::Bedrock::Http::Response const&)>
52 ExponentialBackOff(::std::chrono::seconds baseDelay, ::std::chrono::seconds maxDelay);
53
54#ifdef LL_PLAT_C
55 MCNAPI static ::std::function<::std::optional<::std::chrono::seconds>(::Bedrock::Http::Response const&)>
56 RetryAfterHeader(int maxAttempts);
57#endif
58 // NOLINTEND
59
60public:
61 // constructor thunks
62 // NOLINTBEGIN
63 MCNAPI void*
64 $ctor(::std::function<::std::optional<::std::chrono::seconds>(::Bedrock::Http::Response const&)>&& implementation);
65 // NOLINTEND
66};
67
68} // namespace Bedrock::Http
Definition Response.h:7
static MCAPI ::std::function<::std::optional<::std::chrono::seconds >(::Bedrock::Http::Response const &)> Always(::std::chrono::seconds delay)
static MCAPI ::std::function<::std::optional<::std::chrono::seconds >(::Bedrock::Http::Response const &)> Chained(::std::initializer_list< ::std::function<::std::optional<::std::chrono::seconds >(::Bedrock::Http::Response const &)> > &&retryChain)
static MCAPI ::std::function<::std::optional<::std::chrono::seconds >(::Bedrock::Http::Response const &)> ExponentialBackOff(::std::chrono::seconds baseDelay, ::std::chrono::seconds maxDelay)
MCAPI void * $ctor(::std::function<::std::optional<::std::chrono::seconds >(::Bedrock::Http::Response const &)> &&implementation)
MCAPI RetryPolicy(::std::function<::std::optional<::std::chrono::seconds >(::Bedrock::Http::Response const &)> &&implementation)
MCAPI ::std::optional<::std::chrono::seconds > getDelay(::Bedrock::Http::Response const &response) const
Definition implementation.h:5
Definition Alias.h:14