-
Notifications
You must be signed in to change notification settings - Fork 12
Update README #62
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
Open
Partmedia
wants to merge
1
commit into
qitab:master
Choose a base branch
from
Partmedia:readme
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.
Open
Update README #62
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,17 +7,29 @@ | |
|
|
||
| ## Overview | ||
|
|
||
| This package defines a [gRPC](https://grpc.io/) client library for Common Lisp. | ||
| It wraps gRPC core functions with CFFI calls and uses those core functions to | ||
| create and use a client. client.lisp contains all the necessary functions to | ||
| This package defines a [gRPC](https://grpc.io/) library for Common Lisp. | ||
| It wraps gRPC core functions with CFFI calls. | ||
|
|
||
| ``client.lisp`` contains all the necessary functions to | ||
| create a gRPC client by creating channels (connections between client and | ||
| server) and calls (requests to a server). | ||
|
|
||
| Currently there is support for synchronous and streaming calls over | ||
|
|
||
| SSL, and insecure channels. | ||
|
|
||
| Support for implementing gRPC servers is in development. | ||
| ``server.lisp`` contains a ``run-grpc-server`` function that implements an insecure gRPC server. | ||
|
|
||
| If your service is defined by a protobuf, ``protobuf-integration.lisp`` contains a ``run-grpc-proto-server`` function that serves a gRPC/protobuf service. | ||
|
|
||
|
|
||
| ## Installation | ||
|
|
||
| 1. Install the gRPC library for your platform (e.g. via a package manager). | ||
|
|
||
| 2. Clone this repository into [a location findable by ASDF](https://asdf.common-lisp.dev/asdf.html#Configuring-ASDF-to-find-your-systems). | ||
|
|
||
| 3. In this directory, build the library stub by running ``make``. You may need to make adjustments to the *Makefile* for your platform. | ||
|
|
||
| 4. Load and use this system in your application, e.g. at a REPL with ``(asdf:load-system "grpc")`` or via a ``defsystem``. | ||
|
|
||
| ## Usage | ||
|
|
||
|
|
@@ -230,6 +242,21 @@ Will safely cleanup any data leftover in the `call` object. | |
|
|
||
| This example can be found in examples/client/client-insecure.lisp. | ||
|
|
||
| ### Server | ||
|
|
||
| A minimal gRPC service with protobuf integration looks like: | ||
|
|
||
| ``` | ||
| ; load the protobuf-generated code here | ||
|
|
||
| (defmethod cl-protobufs.testing-rpc::say-hello ((request cl-protobufs.testing:hello-request) call) | ||
| (make-hello-reply :name "world") | ||
|
|
||
| (defun main () | ||
| (grpc:init-grpc) | ||
| (grpc::run-grpc-proto-server "localhost:8080" 'cl-protobufs.testing:greeter)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we should be exporting
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to go do that. |
||
| ``` | ||
|
|
||
| ## Further Reading | ||
|
|
||
| - See https://grpc.io for more information on gRPC. | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe
say-hellois exported.The package names don't look right to me. Assuming the server example uses the same
:local-nicknamesas those in client-insecure.lisp it looks like it should be this instead:(defmethod testing-rpc:say-hello ((request testing:hello-request) call)but I haven't actually tried it. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted to use the fully-qualified names since someone who is testing this in the REPL would have to use those (as opposed to local-nicknames as part of a
defsystem. Let me know your preference and I'll go double check thatsay-hellois exported.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, you've been looking at
examples/client/client-insecure.lispwhich usesexamples/client/helloworld.protowhich definespackage lisp.grpc.integration_testing. However, I've been looking a few lines up in the README, which definespackage testing. This is why we disagree about the namespace.I do think there is value in providing a minimum working example so if there are no objections I'll add that.