forked from grpc/grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gRPC EventEngine Interface (grpc#25795)
- Loading branch information
Showing
30 changed files
with
694 additions
and
50 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# gRPC EventEngine | ||
|
||
An EventEngine handles all cross-platform I/O, task execution, and DNS | ||
resolution for gRPC. A default, cross-platform implementation is provided with | ||
gRPC, but part of the intent here is to provide an interface for external | ||
integrators to bring their own functionality. This allows for integration with | ||
external event loops, siloing I/O and task execution between channels or | ||
servers, and other custom integrations that were previously unsupported. | ||
|
||
*WARNING*: This is experimental code and is subject to change. | ||
|
||
## High level expectations of an EventEngine implementation | ||
|
||
### Provide their own I/O threads | ||
EventEngines are expected to internally create whatever threads are required to | ||
perform I/O and execute callbacks. For example, an EventEngine implementation | ||
may want to spawn separate thread pools for polling and callback execution. | ||
|
||
### Provisioning data buffers via Slice allocation | ||
At a high level, gRPC provides a `ResourceQuota` system that allows gRPC to | ||
reclaim memory and degrade gracefully when memory reaches application-defined | ||
thresholds. To enable this feature, the memory allocation of read/write buffers | ||
within an EventEngine must be acquired in the form of Slices from | ||
SliceAllocators. This is covered more fully in the gRFC and code. | ||
|
||
### Documentating expectations around callback execution | ||
Some callbacks may be expensive to run. EventEngines should decide on and | ||
document whether callback execution might block polling operations. This way, | ||
application developers can plan accordingly (e.g., run their expensive callbacks | ||
on a separate thread if necessary). | ||
|
||
### Handling concurrent usage | ||
Assume that gRPC may use an EventEngine concurrently across multiple threads. | ||
|
||
## TODO: documentation | ||
|
||
* Example usage | ||
* Link to gRFC |
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 @@ | ||
// Copyright 2021 The gRPC Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
#ifndef GRPC_EVENT_ENGINE_CHANNEL_ARGS_H | ||
#define GRPC_EVENT_ENGINE_CHANNEL_ARGS_H | ||
|
||
#include <grpc/support/port_platform.h> | ||
|
||
namespace grpc_event_engine { | ||
namespace experimental { | ||
|
||
// TODO(hork): define | ||
class ChannelArgs; | ||
|
||
} // namespace experimental | ||
} // namespace grpc_event_engine | ||
|
||
#endif // GRPC_EVENT_ENGINE_CHANNEL_ARGS_H |
Oops, something went wrong.