forked from grpc/grpc-java
-
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.
Add ClientTransportFilter (grpc#10646)
* Add ClientTransportFilter
- Loading branch information
1 parent
7692a9f
commit 91d15ce
Showing
20 changed files
with
205 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2023 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. | ||
*/ | ||
|
||
package io.grpc; | ||
|
||
/** | ||
* Listens on the client transport life-cycle events. These filters do not have the capability | ||
* to modify the channels or transport life-cycle event behavior, but they can be useful hooks | ||
* for transport observability. Multiple filters may be registered to the client. | ||
* | ||
* @since 1.61.0 | ||
*/ | ||
@ExperimentalApi("https://gitub.com/grpc/grpc-java/issues/10652") | ||
public abstract class ClientTransportFilter { | ||
/** | ||
* Called when a transport is ready to accept traffic (when a connection has been established). | ||
* The default implementation is a no-op. | ||
* | ||
* @param transportAttrs current transport attributes | ||
* | ||
* @return new transport attributes. Default implementation returns the passed-in attributes | ||
* intact. | ||
*/ | ||
public Attributes transportReady(Attributes transportAttrs) { | ||
return transportAttrs; | ||
} | ||
|
||
/** | ||
* Called when a transport completed shutting down. All resources have been released. | ||
* All streams have either been closed or transferred off this transport. | ||
* Default implementation is a no-op | ||
* | ||
* @param transportAttrs the effective transport attributes, which is what is returned by {@link | ||
* #transportReady} of the last executed filter. | ||
*/ | ||
public void transportTerminated(Attributes transportAttrs) { | ||
} | ||
} |
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
Oops, something went wrong.