Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
4f3840dc
Commit
4f3840dc
authored
9 years ago
by
Michael Lumish
Browse files
Options
Downloads
Plain Diff
Merge pull request #4903 from nicolasnoble/ruby-cleanup
Cleaning up ruby extension code a bit.
parents
eaf944ad
7b92db65
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/ruby/ext/grpc/rb_call.c
+3
-3
3 additions, 3 deletions
src/ruby/ext/grpc/rb_call.c
src/ruby/ext/grpc/rb_call_credentials.c
+2
-0
2 additions, 0 deletions
src/ruby/ext/grpc/rb_call_credentials.c
src/ruby/ext/grpc/rb_event_thread.c
+3
-0
3 additions, 0 deletions
src/ruby/ext/grpc/rb_event_thread.c
with
8 additions
and
3 deletions
src/ruby/ext/grpc/rb_call.c
+
3
−
3
View file @
4f3840dc
...
...
@@ -525,12 +525,12 @@ typedef struct run_batch_stack {
grpc_status_code
recv_status
;
char
*
recv_status_details
;
size_t
recv_status_details_capacity
;
u
int
write_flag
;
u
nsigned
write_flag
;
}
run_batch_stack
;
/* grpc_run_batch_stack_init ensures the run_batch_stack is properly
* initialized */
static
void
grpc_run_batch_stack_init
(
run_batch_stack
*
st
,
u
int
write_flag
)
{
static
void
grpc_run_batch_stack_init
(
run_batch_stack
*
st
,
u
nsigned
write_flag
)
{
MEMZERO
(
st
,
run_batch_stack
,
1
);
grpc_metadata_array_init
(
&
st
->
send_metadata
);
grpc_metadata_array_init
(
&
st
->
send_trailing_metadata
);
...
...
@@ -696,7 +696,7 @@ static VALUE grpc_rb_call_run_batch(VALUE self, VALUE cqueue, VALUE tag,
grpc_call_error
err
;
VALUE
result
=
Qnil
;
VALUE
rb_write_flag
=
rb_ivar_get
(
self
,
id_write_flag
);
u
int
write_flag
=
0
;
u
nsigned
write_flag
=
0
;
TypedData_Get_Struct
(
self
,
grpc_call
,
&
grpc_call_data_type
,
call
);
/* Validate the ops args, adding them to a ruby array */
...
...
This diff is collapsed.
Click to expand it.
src/ruby/ext/grpc/rb_call_credentials.c
+
2
−
0
View file @
4f3840dc
...
...
@@ -79,6 +79,7 @@ static VALUE grpc_rb_call_credentials_callback(VALUE callback_args) {
static
VALUE
grpc_rb_call_credentials_callback_rescue
(
VALUE
args
,
VALUE
exception_object
)
{
VALUE
result
=
rb_hash_new
();
(
void
)
args
;
rb_hash_aset
(
result
,
rb_str_new2
(
"metadata"
),
Qnil
);
/* Currently only gives the exception class name. It should be possible get
more details */
...
...
@@ -132,6 +133,7 @@ static void grpc_rb_call_credentials_plugin_get_metadata(
}
static
void
grpc_rb_call_credentials_plugin_destroy
(
void
*
state
)
{
(
void
)
state
;
// Not sure what needs to be done here
}
...
...
This diff is collapsed.
Click to expand it.
src/ruby/ext/grpc/rb_event_thread.c
+
3
−
0
View file @
4f3840dc
...
...
@@ -102,6 +102,7 @@ static void grpc_rb_event_queue_destroy() {
static
void
*
grpc_rb_wait_for_event_no_gil
(
void
*
param
)
{
grpc_rb_event
*
event
=
NULL
;
(
void
)
param
;
gpr_mu_lock
(
&
event_queue
.
mu
);
while
((
event
=
grpc_rb_event_queue_dequeue
())
==
NULL
)
{
gpr_cv_wait
(
&
event_queue
.
cv
,
...
...
@@ -117,6 +118,7 @@ static void *grpc_rb_wait_for_event_no_gil(void *param) {
}
static
void
grpc_rb_event_unblocking_func
(
void
*
arg
)
{
(
void
)
arg
;
gpr_mu_lock
(
&
event_queue
.
mu
);
event_queue
.
abort
=
true
;
gpr_cv_signal
(
&
event_queue
.
cv
);
...
...
@@ -127,6 +129,7 @@ static void grpc_rb_event_unblocking_func(void *arg) {
* events */
static
VALUE
grpc_rb_event_thread
(
VALUE
arg
)
{
grpc_rb_event
*
event
;
(
void
)
arg
;
while
(
true
)
{
event
=
(
grpc_rb_event
*
)
rb_thread_call_without_gvl
(
grpc_rb_wait_for_event_no_gil
,
NULL
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment