Wraps gRPC channels and provides a mechanism to manage them with Unity's lifecycle.
This prevents your application and the Unity Editor from freezing by releasing channels and StreamingHub in one place.
The editor extension also provides the ability to display the communication status of channels.
NOTE: The data rate is calculated only for the message body of methods, and does not include Headers, Trailers, or Keep-alive pings.
1. Prepare to use GrpcChannelx in your Unity project.
Before creating a channel in your application, you need to initialize the provider host to be managed.
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
public static void OnRuntimeInitialize()
{
// Initialize gRPC channel provider when the application is loaded.
GrpcChannelProviderHost.Initialize(new DefaultGrpcChannelProvider(new []
{
// send keepalive ping every 5 second, default is 2 hours
new ChannelOption("grpc.keepalive_time_ms", 5000),
// keepalive ping time out after 5 seconds, default is 20 seconds
new ChannelOption("grpc.keepalive_timeout_ms", 5 * 1000),
}));
}
GrpcChannelProviderHost will be created as DontDestroyOnLoad and keeps existing while the application is running. DO NOT destory it.
2. Use GrpcChannelx.FromTarget or GrpcChannelx.FromAddress to create a channel.
Use GrpcChannelx.FromTarget or GrpcChannelx.FromAddress to create a channel instead of new Channel(...).
var channel = GrpcChannelx.FromTarget(new GrpcChannelTarget("localhost", 12345, ChannelCredentials.Insecure));
</tr></table>
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps MagicOnion from 4.1.1 to 4.2.0.
Release notes
Sourced from MagicOnion's releases.
... (truncated)
Commits
d05c2f7
feat: Update package.json to 4.2.0e4a9266
Update README.md [skip ci]ef0f038
Merge pull request #419 from Cysharp/hotfix/FixGeneratorForStreamingHubGenerics7afdb8e
Fix handling of Generics for StreamingHub code generationb8fa629
Verify if the generated codes can be compiled successfully.2efee0a
Merge pull request #410 from Cysharp/chore/image6bced65
Merge pull request #414 from Cysharp/feature/GrpcChannelProviderc7609f8
Merge pull request #416 from Cysharp/improve-streminghub-performance1cfb05d
Bump version [skip ci]fde2c97
Fix typoDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)