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
3a0c2e60
Commit
3a0c2e60
authored
9 years ago
by
Michael Lumish
Browse files
Options
Downloads
Plain Diff
Merge pull request #2753 from jcanizales/small-fixes
Small fixes
parents
3d382a0d
faf58b84
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/objective-c/GRPCClient/GRPCCall.m
+3
-11
3 additions, 11 deletions
src/objective-c/GRPCClient/GRPCCall.m
src/objective-c/GRPCClient/private/GRPCCompletionQueue.h
+9
-9
9 additions, 9 deletions
src/objective-c/GRPCClient/private/GRPCCompletionQueue.h
with
12 additions
and
20 deletions
src/objective-c/GRPCClient/GRPCCall.m
+
3
−
11
View file @
3a0c2e60
...
...
@@ -38,7 +38,6 @@
#import <RxLibrary/GRXConcurrentWriteable.h>
#import "private/GRPCChannel.h"
#import "private/GRPCCompletionQueue.h"
#import "private/GRPCWrappedCall.h"
#import "private/NSData+GRPC.h"
#import "private/NSDictionary+GRPC.h"
...
...
@@ -72,7 +71,6 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
dispatch_once_t
_callAlreadyInvoked
;
GRPCChannel
*
_channel
;
GRPCCompletionQueue
*
_completionQueue
;
// The C gRPC library has less guarantees on the ordering of events than we
// do. Particularly, in the face of errors, there's no ordering guarantee at
...
...
@@ -100,19 +98,13 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
path
:(
NSString
*
)
path
requestsWriter
:(
GRXWriter
*
)
requestWriter
{
if
(
!
host
||
!
path
)
{
[
NSException
raise
:
NSInvalidArgumentException
format
:
@"Neither host nor
method
can be nil."
];
[
NSException
raise
:
NSInvalidArgumentException
format
:
@"Neither host nor
path
can be nil."
];
}
if
(
requestWriter
.
state
!=
GRXWriterStateNotStarted
)
{
[
NSException
raise
:
NSInvalidArgumentException
format
:
@"The requests writer can't be already started."
];
[
NSException
raise
:
NSInvalidArgumentException
format:
@"The requests writer can't be already started."
];
}
if
((
self
=
[
super
init
]))
{
static
dispatch_once_t
initialization
;
dispatch_once
(
&
initialization
,
^
{
grpc_init
();
});
_completionQueue
=
[
GRPCCompletionQueue
completionQueue
];
_channel
=
[
GRPCChannel
channelToHost
:
host
];
_wrappedCall
=
[[
GRPCWrappedCall
alloc
]
initWithChannel
:
_channel
...
...
This diff is collapsed.
Click to expand it.
src/objective-c/GRPCClient/private/GRPCCompletionQueue.h
+
9
−
9
View file @
3a0c2e60
...
...
@@ -36,15 +36,15 @@
typedef
void
(
^
GRPCQueueCompletionHandler
)(
bool
success
);
// This class lets one more easily use grpc_completion_queue. To use it, pass
//
the value of the
unmanagedQueue property of an instance of this class to
//
grpc_call_start_invoke. Then for
every grpc_call_* method that accepts a tag,
//
you can pass a block of type GRPCEvent
Handler (remembering to cast it using
//
__bridge_retained). The block is
guaranteed to eventually be called, by a
//
concurrent queue, and then released. Each such block is passed a pointer to
//
the grpc_event that carried it (in event->tag).
// Release the GRPCCompletionQueue object only after you are not going to pass
//
any more blocks to
the grpc_call that's using it.
// This class lets one more easily use
|
grpc_completion_queue
|
. To use it, pass
the value of the
//
|
unmanagedQueue
|
property of an instance of this class to
|grpc_channel_create_call|. Then for
// every
|
grpc_call_*
|
method that accepts a tag,
you can pass a block of type
//
|GRPCQueueCompletion
Handler
|
(remembering to cast it using
|__bridge_retained|). The block is
// guaranteed to eventually be called, by a
concurrent queue, and then released. Each such block is
//
passed a |bool| that tells if the operation was successful.
//
// Release the GRPCCompletionQueue object only after you are not going to pass
any more blocks to
// the
|
grpc_call
|
that's using it.
@interface
GRPCCompletionQueue
:
NSObject
@property
(
nonatomic
,
readonly
)
grpc_completion_queue
*
unmanagedQueue
;
...
...
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