-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change implements fire and forget request shadow logic in the router.
- Loading branch information
1 parent
d1c5c10
commit f5a6fea
Showing
24 changed files
with
564 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include "envoy/http/message.h" | ||
|
||
namespace Router { | ||
|
||
/** | ||
* Interface used to shadow complete requests to an alternate upstream cluster in a "fire and | ||
* forget" fashion. Right now this interface takes a fully buffered request and cannot be used for | ||
* streaming. This is sufficient for current use cases. | ||
*/ | ||
class ShadowWriter { | ||
public: | ||
virtual ~ShadowWriter() {} | ||
|
||
/** | ||
* Shadow a request. | ||
* @param cluster supplies the cluster name to shadow to. | ||
* @param message supplies the complete request to shadow. | ||
* @param timeout supplies the shadowed request timeout. | ||
*/ | ||
virtual void shadow(const std::string& cluster, Http::MessagePtr&& request, | ||
std::chrono::milliseconds timeout) PURE; | ||
}; | ||
|
||
typedef std::unique_ptr<ShadowWriter> ShadowWriterPtr; | ||
|
||
} // Router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.