-
Notifications
You must be signed in to change notification settings - Fork 89
Merging capnproto-java-rpc
#149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sebastianbergt
wants to merge
260
commits into
capnproto:master
Choose a base branch
from
sebastianbergt:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 250 commits
Commits
Show all changes
260 commits
Select commit
Hold shift + click to select a range
7713316
incoming and outgoing rpc messages
vaci 385746d
add two-party RPC protocol
vaci e1548e8
RPC exception serialization
vaci 76c81a7
start to flesh out RPC connection state
vaci 10f8f5e
implement import and export tables
vaci 7ee0a60
stub handlers and test cases for incoming rpc messages
vaci 66ae27e
mock rpc connection
vaci b3c5b03
handle bootstrapping request
vaci 37fe39b
implement unimplemented
vaci 15b83a9
implement local, queued and promised hooks
vaci 37c93cc
implement request send
vaci f5e4630
implement capability client and server
vaci 4a77f67
twoparty rpc
vaci 3959732
handle resolve
vaci a505c03
extend fromPointerReader to accept capTable
vaci 4dada05
make CallContext constructor public
vaci 9c5e080
regenerated rpc schemas
vaci 7d3e790
add runOnce to Client
vaci 194c0ad
correct setter of capability pointer
vaci 7ae49a8
RpcState bug fixes
vaci 1913b6d
minor scope changes to cap client and server
vaci c938938
CapTables everywhere!
vaci 6bd1411
handleDisembargo. NB future evaluation order needs work
vaci 734af71
handleFinish
vaci 07dbf22
avoid repetition of getResultsBuilder call
vaci 81b151d
oops, correct FromPointerBuilder default call
vaci be64ced
demo schema with interfaces
vaci b94f2d6
prep for generated code
vaci 3b0e3f3
generate (non-generic) interfaces and capability accessors
vaci 218529d
add client factory for AnyPointer accessor
vaci 59977b5
generate client methods and add streaming
vaci 2ffdecb
Make Response typed
vaci 1abc975
defer disembargo
vaci 606dd26
generate pipelines, add AnyPointer.Pipeline
vaci c2f64ba
Add local cap table to message builder.
vaci dea4d2d
implement bulk of pipelining logic
vaci 61c98ac
avoid duplicating conditions in asserts
vaci 8945187
simplify server runOnce
vaci c49221c
add cleanup to questions and imports
vaci caec63d
fix rpcsystem generic params, and hide various fields
vaci 7134461
use weak refs to cleanup import table
vaci 730ca1a
question cleanup
vaci 85a3565
add fds accessor
vaci 215f485
add network accessor
vaci 7b939d7
add moar size hints
vaci c01228c
add tap for dumping rpc messages
vaci 6d082a7
use getHook() accessor
vaci 05dc84b
move more CompFutures to void
vaci 83a4d4d
only tap incoming
vaci f28b7de
more message building size hints
vaci 633d3ff
remove redundent AnyPointer.getAsCap
vaci e21ba57
accept default outgoing message size
vaci 3161e24
tidy up TwoPartyVatNetwork
vaci 011137b
remove unused TwoPartyClient.runOnce
vaci 9315c8a
null cap test
vaci 8ccfdc1
remove redundent final modifier
vaci caa4441
fix local resolver, null caps, and add some doc comments
vaci e19faf0
tidy up cap table in BuilderArena
vaci 9268494
Generate generic pipelines
vaci cd1fc4c
make embargo.diembargo final
vaci 13156f9
remove extraneous writeTarget method
vaci 88a8140
use Java 14 to compile all modules
vaci debfda7
try to run workflow with Java 14
vaci d6a1639
fix RpcState tests
vaci 4bb8f6a
remove synchronised modifier from handleMessage
vaci 1bf4bfc
add ServerSets
vaci dc4f8d0
dump more message types
vaci 4f8c5fa
tidy up access to hooks
vaci c903cbf
return this network via asConnection()
vaci f2b2fc7
go back to using CompletableFuture (sigh)
vaci 94ca2a0
remove sync modifier from getConnectionState and tidy
vaci 86ccdd5
move cleanup to end of message loop
vaci 2d8fe31
generic interface generation (WIP
vaci 8eacc8c
major refactor of RemotePromise and Pipeline
vaci d515500
get rid of PipelineBase and PipelineImpl again
vaci a68b6ed
schema generation script for dev work
vaci a10e48d
test schemas
vaci 8565c40
capability test suite
vaci 069da9b
tidy up generated output and remove dead code
vaci aaa11f7
reduce gen script paths
vaci 33d16c4
add READY_NOW
vaci 630d71d
implement more capability tests
vaci 02789ac
add TestInterface.baz. Stub out broken TestGenerics
vaci 5187692
remove generated schema.schema
vaci dba99ca
combine javaFullName methods
vaci 407d25c
tidy up interface generation
vaci 9d023f0
fix generic pipeline params. add (non-generic, for now) capability list
vaci 054213a
add rpc bootstrap factory
vaci 1f00477
rpc tests
vaci 7d2e541
fix getNetwork bug, remove unnecessary TwoPartVatNetwork specialisation
vaci e8a118f
add overload for messageSizeHint
vaci 850a603
oops, correct assertion of missing question
vaci 95787f1
skip non-generic nodes when traversing for generic params
vaci d2d851d
stub out generic pipeline accessors, for now
vaci 0ce52fe
add resolve test and fix handleResolve bugs
vaci 713f008
stub out two-party test suite for now
vaci 66fc361
stub out two-party test suite for now
vaci 45d1470
make anypipeline.noop public
vaci 6b8898c
make noop public
vaci 0283fc5
add lite mode for compiler
vaci 9e6d495
add runtime-rpc module and refactor project
vaci 59c8f64
Merge branch 'capnpc-java-lite'
vaci 8457c38
fix null exportId bug
vaci 7b79ab8
avoid TestUtil name clash
vaci f640a8f
allow copyPointer to copy capabilities
vaci cee3aa7
set AnyPointer from AnyPointer
vaci f2df5c2
implement rpc tail calls
vaci e04adc9
embargo test and tribble
vaci cefd8ea
add AnyStruct
vaci ce8ecc5
bump travis to jdk14
vaci 1e7b03d
point readme to our travis badge
vaci 40aebee
Move compiler test package to correct directory
vaci 0ff8197
avoid test package name clash
vaci b1be88d
bump capnproto C++ runtime to version 0,8.0 in travis CI
vaci f05c994
correct module description
vaci c30dba3
add callBrokenPromise test
vaci dcd9eb3
add override to set clients from completablefutures
vaci f3bb329
generalise AnyPointer setAs AnyPointer
vaci cd8e096
small tidy of RpcState
vaci d526eca
resolve PromiseClient requests in order
vaci ce9e168
dont aggressively clean up answer pipelines
vaci c8c8c8a
just catch Exception when failing to send abort
vaci af47f1a
simplify iteration of (weak) question table
vaci 2ddc8e1
run the message loop asynchronously
vaci 4e9e7f4
cancellation
vaci 69a045d
make requests autoclosable and cleanup disconnection
vaci c0a57d3
merge resolveTask into constructor
vaci 37aa04b
allow network to use bytechannels
vaci ad17a4c
refactor connection and disconnection
vaci c2423d4
improve question lifecycle handling
vaci bac65db
Merge remote-tracking branch 'sandstorm/master'
vaci f0d4d9d
add embargoUnwrap test
vaci 6e066d4
send abort to close test connection
vaci 330eb50
disconnect test networks on close
vaci 9f13f29
implement missing overrides for PromiseClient
vaci 224bc3a
oops, ensure bootstrap uses the questionRef promise
vaci 3513db0
setup/teardown rpc tests
vaci 054e4ef
Revert "resolve PromiseClient requests in order"
vaci 13dec22
implement evalLast queue
vaci d6112f0
allow for testEmbargoUnwrapped ordering
vaci 709751a
add logging for inbound messages
vaci 5e797d3
remove baseAccept and tidy TowPartyVatNetwork
vaci 68edac5
remove unused getVatIdFactory()
vaci f0fbaac
avoid null bootstrap interface
vaci af229cc
cleanup minor code quality issues in RpcState
vaci 0c4e988
ensure whenMoreResolved resolves to eventual client in PromiseClient
vaci 1366e28
simplify conversion to CompletableFuture<Void>
vaci d3e639e
add capability tail call test
vaci e314d26
use sendInternal rather than calling hook directly
vaci 1cadca6
add releaseCall to delay call execution
vaci 5289247
serialise write and correct chaining
vaci 119a682
memoise queuespipeline caps. use queues to order queuedclient resolution
vaci cdb719e
oops, invert senderLoopback assertion
vaci beec84a
calling thread drives client side loop
vaci 3b642d0
add a delay to testTailCall
vaci 9465ffd
add default getBrand to RequestHook
vaci 5a27b4b
tidy up Builder refs in AnyPointer.Pipeline
vaci 594e5e3
reduce visibility of cap contexts
vaci fb5f1bf
cleanup import lifecycle
vaci 2d072a6
implement streaming requests
vaci 941a254
by default, streaming calls fal back to regular calls
vaci 07f8f22
implement call blocking stack
vaci de85613
consistent naming of factories
vaci e3d52a0
use gather writes for AsynchronousSocketChannels
vaci 359dae8
lower logging level to FINE
vaci 3ba9695
disembargo promise is always non-null
vaci 772108f
add testEmbargoNull test
vaci 6326f96
new style resolve switch
vaci 60690c1
fix construction of never-resolving pipeline
vaci a2a17ea
remove CapabilityServerSetBase, add test case
vaci a3837e6
message loop exit logging level as FINE
vaci b5c1c48
all channels are socket channels
vaci 585a212
remove unused AnyRequest.send()
vaci 6e5bcc6
replace typeless requests with anonymous implementations
vaci 250f14e
simplify QueuedPipeline promise
vaci a53f7db
remove extraneous ArrayList wrapper from ops key
vaci 789d2df
replace PipelineOp[] with short[]
vaci ab44843
QueuedClient should stop queuing calls once it has resolved
vaci 66ee947
replace Integers with FileDescriptors
vaci c66250f
remove sizeHint branch from new outgoing messages
vaci d02e460
tidy up response and pipeline construction
vaci c04bdb8
add clienthook commentary
vaci 2b5bf0e
tidy up branding and implement QueuedClient,getBrand() correctly
vaci e9493cf
ensure group access pipelines are created
vaci 837f1b3
add AnyList
vaci 3b1f5f4
use lists for queued calls, clean up on resolution
vaci 53eeed9
make direct call if QueuedClient has resolved
vaci e3eabe6
copy params in direct tail call
vaci 998b569
add ez-rpc
vaci f74ad80
remove cancellation completion for now
vaci 196b825
ensure StructBuilders and StructLists maintain capTable context
vaci 25c50b1
moar capTable context maintenance
vaci ecd034e
add calculator example
vaci 635bfa0
imports
vaci 21d3eba
remove CompletableFutureWrapper
vaci c7621d1
whenMoreResolved should return null when resolved
vaci 23c3c78
combine cleanup methods
vaci c9dcefb
EzRpcClient must connect synchronously
vaci 59c6913
EzRpcServer expects internet sockets
vaci 22e5ab3
Merge remote-tracking branch 'sandstorm/master'
vaci 2dcaebb
github CI workflow
vaci 4f55af4
remove excess client construction from EzRpcClient
vaci 21b8aa6
add gitlab CI
vaci 3d81962
add gitlab CI to master
vaci 1bf1228
revert to java version 11
vaci 950ba82
use java11 switches and completablefutures
vaci 6122523
Merge pull request #15 from vaci/vaci/java11-backport
vaci b24a362
Merge from upstream
4fc6ffd
try fixing jdk version to 11
6e3fa81
add some colour to the README
f37f934
wqbump runtime-rpc dependencies to 0.1.10
eab8829
Merge pull request #18 from vaci/vaci/merge-0110
vaci 2731586
fix "questionId is already in use" error
aarcangeli d3bdb29
Merge pull request #19 from aarcangeli/patch-1
vaci 9a32482
Merge remote-tracking branch 'sandstorm/master' into vaci/merge2
vaci 84dcb10
correct pom version
vaci 9bb1032
avoid truncating struct size
vaci 2e319ce
Merge pull request #20 from vaci/vaci/merge2
vaci 42d5535
Track fix to ordering bug as described here:
vaci 97e4766
Merge pull request #22 from vaci/vaci/rpc-ordering
vaci 3b4ee42
remove unused import
vaci 845186f
Merge pull request #23 from vaci/vaci/unused-import
vaci 59701de
Provide fallback to original interface.
vaci 4171577
Move NULL and BROKEN brands to ClientHook
vaci 8c6b9c8
Avoid use of var
vaci f510bd1
move captable contexts
vaci 3ec3dba
remove captable contexts from capability
vaci 7c521d5
avoid var in ClientHook
vaci 88182b9
Merge pull request #24 from vaci/vaci/portability
vaci 3119bb5
Fix generic structs with non-generic interface as type parameter.
01b5a6c
Merge pull request #25 from jan-br/master
vaci 949103c
Merge remote-tracking branch 'sandstorm/master'
vaci af9c109
CI token (#31)
vaci ced3f11
Specify OpenJDK version for JitPack (#28)
vaci e77372b
Fix integer overflow in bounds checking
mdindoffer 89d1c57
Fix integer overflow in computeSerializedSizeInWords
mdindoffer b1eadae
Fix intege overflow in _setBooleanElement in a primitive list
mdindoffer 529a3da
Fix integer overflow in setListPointer size calculation
mdindoffer 58c906f
Introduce constant for nesting limit in LayoutTest
mdindoffer 04d0692
Fix integer overflow when calculating zeroing range in zeroObject
mdindoffer e8338d8
Performance-related cleanup
mdindoffer 2094289
Avoid duplicate bitwise operations when reading primitive list pointers
mdindoffer ee0d727
pass null captable in ListReader test
vaci e3f447d
use java nio AsynchronousByteChannel instead for Serialize
ca7ceed
remove AsynchronousByteListenChannel
vaci 1a36fd8
Update README.md
vaci 7d7f229
merging capnproto-java master back into capnproto-java-rpc
sebastianbergt 8c74174
Update README.md
sebastianbergt e7c91ca
downgrade versions except for examples
sebastianbergt aeb56e0
restore CI
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,18 @@ | ||
| image: capnproto-gitlab-builder | ||
|
|
||
| stages: | ||
| - build | ||
| - quality | ||
|
|
||
| build: | ||
| stage: build | ||
| script: | ||
| - mvn -e -X clean compile | ||
|
|
||
| test: | ||
| stage: quality | ||
| dependencies: | ||
| - build | ||
| script: | ||
| - mvn -e -X test | ||
|
|
This file contains hidden or 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,7 @@ | ||
| <component name="ProjectRunConfigurationManager"> | ||
| <configuration default="false" name="Calculator" type="CompoundRunConfigurationType"> | ||
| <toRun name="CalculatorServer" type="Application" /> | ||
| <toRun name="CalculatorClient" type="Application" /> | ||
| <method v="2" /> | ||
| </configuration> | ||
| </component> |
This file contains hidden or 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,13 @@ | ||
| <component name="ProjectRunConfigurationManager"> | ||
| <configuration default="false" name="CalculatorClient" type="Application" factoryName="Application"> | ||
| <option name="ALTERNATIVE_JRE_PATH" value="openjdk-14" /> | ||
| <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" /> | ||
| <option name="MAIN_CLASS_NAME" value="org.capnproto.examples.CalculatorClient" /> | ||
| <module name="examples" /> | ||
| <option name="PROGRAM_PARAMETERS" value="localhost:6567" /> | ||
| <method v="2"> | ||
| <option name="Make" enabled="true" /> | ||
| <option name="FwBeforeLaunchTask" enabled="true" /> | ||
| </method> | ||
| </configuration> | ||
| </component> |
This file contains hidden or 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,12 @@ | ||
| <component name="ProjectRunConfigurationManager"> | ||
| <configuration default="false" name="CalculatorServer" type="Application" factoryName="Application"> | ||
| <option name="ALTERNATIVE_JRE_PATH" value="openjdk-14" /> | ||
| <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" /> | ||
| <option name="MAIN_CLASS_NAME" value="org.capnproto.examples.CalculatorServer" /> | ||
| <module name="examples" /> | ||
| <option name="PROGRAM_PARAMETERS" value="localhost:6567" /> | ||
| <method v="2"> | ||
| <option name="Make" enabled="true" /> | ||
| </method> | ||
| </configuration> | ||
| </component> |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,8 +1,20 @@ | ||
| # capnproto-java: Cap'n Proto for Java | ||
|
|
||
| [](https://github.com/capnproto/capnproto-java/actions?query=workflow%3ACI) | ||
| [](https://github.com/vaci/capnproto-java-rpc/actions?query=workflow%3ACI) | ||
|
|
||
| [Cap'n Proto](http://capnproto.org) is an extremely efficient protocol for sharing data | ||
| and capabilities, and capnproto-java is a pure Java implementation. | ||
|
|
||
| [Read more here.](https://dwrensha.github.io/capnproto-java/index.html) | ||
|
|
||
| This repository clone adds an implementation of the RPC framework for Java. | ||
|
|
||
| Promise pipelining is provided via java.util.concurrent.CompletableFuture. Unlike the KJ asynchronous model, which completes promises | ||
| only when they are waited upon, a CompletableFuture can complete immediately. This may break E-ordering, as the C++ implementation | ||
| relies on kj::evalLater() to defer method calls and this implementation may have subtle differences. | ||
|
|
||
| Most of the C++ RPC test cases have been ported to this implementation, which gives me some comfort that the implementation logic is | ||
| correct, but more extensive testing is required. | ||
|
|
||
| This implementation does not support generic interfaces. Extending the schema compiler to output code for generic interfaces is an | ||
| exercise I leave to the reader. | ||
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.