File tree Expand file tree Collapse file tree
api/src/main/java/com/getcode/network
app/src/main/java/com/getcode Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class AccountApi @Inject constructor(
2222 managedChannel : ManagedChannel ,
2323 private val scheduler : Scheduler = Schedulers .io(),
2424) : GrpcApi(managedChannel) {
25- private val api = AccountGrpc .newStub(managedChannel)
25+ private val api = AccountGrpc .newStub(managedChannel).withWaitForReady()
2626
2727 fun isCodeAccount (owner : KeyPair ): Flow <AccountService .IsCodeAccountResponse > {
2828 val request = AccountService .IsCodeAccountRequest .newBuilder()
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import com.getcode.model.chat.SetSubscriptionStateResponseV1 as SetSubscriptionS
3333class ChatApiV1 @Inject constructor(
3434 managedChannel : ManagedChannel
3535) : GrpcApi(managedChannel) {
36- private val api = ChatGrpc .newStub(managedChannel)
36+ private val api = ChatGrpc .newStub(managedChannel).withWaitForReady()
3737
3838 fun fetchChats (owner : KeyPair ): Flow <GetChatsResponse > {
3939 val request = GetChatsRequest .newBuilder()
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ import com.getcode.model.chat.SetSubscriptionStateResponseV2 as SetSubscriptionS
5353class ChatApiV2 @Inject constructor(
5454 managedChannel : ManagedChannel
5555) : GrpcApi(managedChannel) {
56- private val api = ChatGrpc .newStub(managedChannel)
56+ private val api = ChatGrpc .newStub(managedChannel).withWaitForReady()
5757
5858 fun startChat (
5959 owner : KeyPair ,
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import javax.inject.Inject
1515class CurrencyApi @Inject constructor(
1616 managedChannel : ManagedChannel ,
1717) : GrpcApi(managedChannel) {
18- private val api = CurrencyGrpc .newStub(managedChannel)
18+ private val api = CurrencyGrpc .newStub(managedChannel).withWaitForReady()
1919
2020 fun getRates (request : CurrencyService .GetAllRatesRequest = CurrencyService .GetAllRatesRequest .getDefaultInstance()): Flow <CurrencyService .GetAllRatesResponse > =
2121 api::getAllRates
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class DeviceApi @Inject constructor(
1717 managedChannel : ManagedChannel ,
1818): GrpcApi(managedChannel) {
1919
20- private val api = DeviceGrpc .newStub(managedChannel)
20+ private val api = DeviceGrpc .newStub(managedChannel).withWaitForReady()
2121
2222 fun registerInstallation (owner : KeyPair , installationId : String ) : Flow <DeviceService .RegisterLoggedInAccountsResponse > {
2323 val request = DeviceService .RegisterLoggedInAccountsRequest .newBuilder()
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class IdentityApi @Inject constructor(
1919 managedChannel : ManagedChannel ,
2020 private val scheduler : Scheduler = Schedulers .io(),
2121) : GrpcApi(managedChannel) {
22- private val api = IdentityGrpc .newStub(managedChannel)
22+ private val api = IdentityGrpc .newStub(managedChannel).withWaitForReady()
2323
2424 fun linkAccount (request : IdentityService .LinkAccountRequest ): @NonNull Single <IdentityService .LinkAccountResponse > {
2525 return api::linkAccount
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class MessagingApi @Inject constructor(
2020 managedChannel : ManagedChannel ,
2121 private val scheduler : Scheduler = Schedulers .io()
2222) : GrpcApi(managedChannel) {
23- private val api = MessagingGrpc .newStub(managedChannel)
23+ private val api = MessagingGrpc .newStub(managedChannel).withWaitForReady()
2424
2525 fun openMessageStream (request : OpenMessageStreamRequest ): Flowable <OpenMessageStreamResponse > =
2626 api::openMessageStream
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class PhoneApi @Inject constructor(
1414 managedChannel : ManagedChannel ,
1515 private val scheduler : Scheduler = Schedulers .io(),
1616) : GrpcApi(managedChannel) {
17- private val api = PhoneVerificationGrpc .newStub(managedChannel)
17+ private val api = PhoneVerificationGrpc .newStub(managedChannel).withWaitForReady()
1818
1919 fun sendVerificationCode (request : PhoneVerificationService .SendVerificationCodeRequest ): @NonNull Single <PhoneVerificationService .SendVerificationCodeResponse > {
2020 return api::sendVerificationCode
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class PushApi @Inject constructor(
1414 managedChannel : ManagedChannel ,
1515 private val scheduler : Scheduler = Schedulers .io(),
1616) : GrpcApi(managedChannel) {
17- private val api = PushGrpc .newStub(managedChannel)
17+ private val api = PushGrpc .newStub(managedChannel).withWaitForReady()
1818
1919 fun addToken (request : PushService .AddTokenRequest ): @NonNull Single <PushService .AddTokenResponse > {
2020 return api::addToken
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class TransactionApiV2 @Inject constructor(
1919 managedChannel : ManagedChannel ,
2020 private val scheduler : Scheduler = Schedulers .io(),
2121) : GrpcApi(managedChannel) {
22- private val api = TransactionGrpc .newStub(managedChannel)
22+ private val api = TransactionGrpc .newStub(managedChannel).withWaitForReady()
2323
2424 fun submitIntent (request : StreamObserver <TransactionService .SubmitIntentResponse >): StreamObserver <TransactionService .SubmitIntentRequest > {
2525 return api.submitIntent(request)
You can’t perform that action at this time.
0 commit comments