Page MenuHomePhabricator

Define tokio runtime
AbandonedPublic

Authored by marcin on Sep 5 2022, 7:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 13, 5:22 PM
Unknown Object (File)
Mon, May 13, 2:56 PM
Unknown Object (File)
Thu, May 9, 5:20 PM
Unknown Object (File)
Thu, May 9, 5:20 PM
Unknown Object (File)
Thu, May 9, 5:20 PM
Unknown Object (File)
Mon, Apr 29, 12:38 AM
Unknown Object (File)
Mon, Apr 29, 12:38 AM
Unknown Object (File)
Mon, Apr 29, 12:38 AM

Details

Summary

This differential creates static variable with tokio runtime. This runtime will be used to execute tasks with gRPC calls.

Test Plan

Cargo build from prject root

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

marcin requested review of this revision.Sep 5 2022, 7:52 AM
tomek added 1 blocking reviewer(s): jon.
tomek added inline comments.
native/cpp/CommonCpp/grpc/blob_client/rust/src/lib.rs
10 ↗(On Diff #16330)

Do we really need to use Arc?

native/cpp/CommonCpp/grpc/blob_client/rust/src/lib.rs
10 ↗(On Diff #16330)

No, global singletons do not need Arc.

karol has moved this work to https://linear.app/comm/issue/ENG-1732

native/cpp/CommonCpp/grpc/blob_client/rust/src/lib.rs
10 ↗(On Diff #16330)

Agree, Arc is not needed here. I will use Rc instead.

native/cpp/CommonCpp/grpc/blob_client/rust/src/lib.rs
10 ↗(On Diff #16330)

Sorry for the confusion above - actually I do not even need Rc<> here.

This revision is now accepted and ready to land.Sep 7 2022, 12:50 PM
native/cpp/CommonCpp/grpc/blob_client/rust/src/lib.rs
14 ↗(On Diff #16409)

Should this unwrap call be here? Context here, cc @varun @jon

This revision now requires review to proceed.Sep 15 2022, 12:34 PM
native/cpp/CommonCpp/grpc/blob_client/rust/src/lib.rs
14 ↗(On Diff #16409)

Generally I prefer expect. At least it emits an error message which then you can search for in the code base.

I created this revision when I thought my blob client will be a separate binary. But we agreed that we will have one Rust crate for all native gRPC so I assume that my blob client will be using the same runtime that is already defined in grpc_client/src/lib.rs and used by identity client. So we can either abandon this revision, or use it to update runtime definition that is already on master once grpc_client refactor is done.

unwrap is fine, but as @marcin said this diff should just be discarded or used to modify the runtime here

Refactor after varun's changes. Introduced changes to runtime declaration - Wrapping in Arc is not necessary

This revision is now accepted and ready to land.Sep 19 2022, 11:05 AM

Diff from 2022 what I was assigned encrypted blob upload work.