A ProtocDriver instance provides a platform-dependent way to launch protoc and
and set up a two-way communication channel between protoc and this JVM.
protoc is able to launch plugins. A plugin is expected to take a serialized
CodeGenerationRequest via stdin and serialize a CodeGenerationRequest to stdout.
The idea in ProtocDriver is to create a minimal plugin that wires its stdin/stdout
to this JVM.
The two-way communication always goes as follows:
1. protoc writes a request to the stdin of a plugin
2. plugin writes the data to the channel
3. this JVM reads it, interprets it as CodeGenerationRequest and process it.
4. this JVM writes a CodeGenerationResponse to the channel
5. this JVM closes the channel.
6. the plugin reads the data and writes it to standard out.
7. protoc handles the CodeGenerationResponse (creates Scala sources)
A ProtocDriver instance provides a platform-dependent way to launch protoc and and set up a two-way communication channel between protoc and this JVM.
protoc is able to launch plugins. A plugin is expected to take a serialized CodeGenerationRequest via stdin and serialize a CodeGenerationRequest to stdout. The idea in ProtocDriver is to create a minimal plugin that wires its stdin/stdout to this JVM.
The two-way communication always goes as follows:
1. protoc writes a request to the stdin of a plugin 2. plugin writes the data to the channel 3. this JVM reads it, interprets it as CodeGenerationRequest and process it. 4. this JVM writes a CodeGenerationResponse to the channel 5. this JVM closes the channel. 6. the plugin reads the data and writes it to standard out. 7. protoc handles the CodeGenerationResponse (creates Scala sources)