-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83aba29
commit 7b7a80e
Showing
9 changed files
with
71 additions
and
17 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 |
---|---|---|
|
@@ -34,6 +34,12 @@ | |
* Interface for an RPC callback, normally called when an RPC completes. | ||
* {@code ParameterType} is normally the method's response message type. | ||
* | ||
* <p>Starting with version 2.3.0, RPC implementations should not try to build | ||
* on this, but should instead provide code generator plugins which generate | ||
* code specific to the particular RPC implementation. This way the generated | ||
* code can be more appropriate for the implementation in use and can avoid | ||
* unnecessary layers of indirection. | ||
* | ||
* @author [email protected] Kenton Varda | ||
*/ | ||
public interface RpcCallback<ParameterType> { | ||
|
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 |
---|---|---|
|
@@ -44,6 +44,12 @@ | |
* service.myMethod(controller, request, callback); | ||
* </pre> | ||
* | ||
* <p>Starting with version 2.3.0, RPC implementations should not try to build | ||
* on this, but should instead provide code generator plugins which generate | ||
* code specific to the particular RPC implementation. This way the generated | ||
* code can be more appropriate for the implementation in use and can avoid | ||
* unnecessary layers of indirection. | ||
* | ||
* @author [email protected] Kenton Varda | ||
*/ | ||
public interface RpcChannel { | ||
|
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 |
---|---|---|
|
@@ -37,6 +37,12 @@ | |
* interface can be used to call the methods of the service without knowing | ||
* its exact type at compile time (analogous to the Message interface). | ||
* | ||
* <p>Starting with version 2.3.0, RPC implementations should not try to build | ||
* on this, but should instead provide code generator plugins which generate | ||
* code specific to the particular RPC implementation. This way the generated | ||
* code can be more appropriate for the implementation in use and can avoid | ||
* unnecessary layers of indirection. | ||
* | ||
* @author [email protected] Kenton Varda | ||
*/ | ||
public interface Service { | ||
|
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 |
---|---|---|
|
@@ -28,12 +28,16 @@ | |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
"""Declares the RPC service interfaces. | ||
"""DEPRECATED: Declares the RPC service interfaces. | ||
This module declares the abstract interfaces underlying proto2 RPC | ||
services. These are intended to be independent of any particular RPC | ||
implementation, so that proto2 services can be used on top of a variety | ||
of implementations. | ||
of implementations. Starting with version 2.3.0, RPC implementations should | ||
not try to build on these, but should instead provide code generator plugins | ||
which generate code specific to the particular RPC implementation. This way | ||
the generated code can be more appropriate for the implementation in use | ||
and can avoid unnecessary layers of indirection. | ||
""" | ||
|
||
__author__ = '[email protected] (Petar Petrov)' | ||
|
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 |
---|---|---|
|
@@ -29,6 +29,28 @@ | |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
// Author: [email protected] (Kenton Varda) | ||
// | ||
// Front-end for protoc code generator plugins written in C++. | ||
// | ||
// To implement a protoc plugin in C++, simply write an implementation of | ||
// CodeGenerator, then create a main() function like: | ||
// int main(int argc, char* argv[]) { | ||
// MyCodeGenerator generator; | ||
// return google::protobuf::compiler::PluginMain(argc, argv, &generator); | ||
// } | ||
// You must link your plugin against libprotobuf and libprotoc. | ||
// | ||
// To get protoc to use the plugin, do one of the following: | ||
// * Place the plugin binary somewhere in the PATH and give it the name | ||
// "protoc-gen-NAME" (replacing "NAME" with the name of your plugin). If you | ||
// then invoke protoc with the parameter --NAME_out=OUT_DIR (again, replace | ||
// "NAME" with your plugin's name), protoc will invoke your plugin to generate | ||
// the output, which will be placed in OUT_DIR. | ||
// * Place the plugin binary anywhere, with any name, and pass the --plugin | ||
// parameter to protoc to direct it to your plugin like so: | ||
// protoc --plugin=protoc-gen-NAME=path/to/mybinary --NAME_out=OUT_DIR | ||
// On Windows, make sure to include the .exe suffix: | ||
// protoc --plugin=protoc-gen-NAME=path/to/mybinary.exe --NAME_out=OUT_DIR | ||
|
||
#ifndef GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__ | ||
#define GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__ | ||
|
@@ -41,12 +63,7 @@ namespace compiler { | |
|
||
class CodeGenerator; // code_generator.h | ||
|
||
// To implement a protoc plugin in C++, simply write an implementation of | ||
// CodeGenerator, then create a main() function like: | ||
// int main(int argc, char* argv[]) { | ||
// MyCodeGenerator generator; | ||
// return PluginMain(argc, argv, &generator); | ||
// } | ||
// Implements main() for a protoc plugin exposing the given code generator. | ||
LIBPROTOC_EXPORT int PluginMain(int argc, char* argv[], const CodeGenerator* generator); | ||
|
||
} // namespace compiler | ||
|
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