Questions tagged [suspend]

469 questions
4
votes
0 answers

How to suspend WPF Window to render before not all desired properties are set?

I have quite a simple question regarding the rendering thread in WPF and dotNet4.0. How can I avoid that the rendering thread is already starting to render before I have set all my dependency properties what I want to set. I like to set the new…
3
votes
2 answers

Continuations or suspend and resume in the Servlet 3.0 API for communication with the client?

We are in the process of migrating a Swing two tier application to a web application (tomcat, Spring MVC, extJS if it makes any difference). We found code like this in the application (simplified Javaesc pseudo code). class…
Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
3
votes
1 answer

wxWidgets wxWinCE suspend-resume crash (VC++)

I have an issue with a few Windows CE 5.0 devices which are crashing virtually as soon as they resume from standby (suspend). I have condensed the issue down to about 15 lines of C++ to simply get wxWidgets to display a message box, and the problem…
user1107787
3
votes
3 answers

How to make Java app detect that the Linux PC has resumed from suspended state (sleep mode)?

In a Java Swing desktop application running on Linux (e.g., Ubuntu), how can the application be notified that the PC has just resumed from the sleep/suspended/hibernated state? Screen blanking is not a concern. All other suspended or hibernated…
MountainX
  • 6,217
  • 8
  • 52
  • 83
3
votes
1 answer

Rooted Android: Suspend and warn user when any App accesses Contacts List, Microphone or Camera?

I have Users with rooted Android 2.2+ smartphone devices. Whenever any on-device App accesses the device's Contacts List, Microphone or Camera resource, I want to Suspend that App, pop up a warning message to the User, and let the User decide…
3
votes
6 answers

Kotlin compose how to know when suspend function is finished?

This is the complete flow: this is in the user profile: .clickable { loginViewModel.onLogout() isLogin= false } isLogin should be assign to false only when doLogout is finished How can I run another function or code only when…
3
votes
1 answer

Windows: Atomically suspend an entire process?

Using Win32 API it is only possible to suspend a single thread using SuspendThread() but not a complete process in one call. Iterating over a process threads and suspending them one at a time is not a good option since it may cause dead-locks and…
shoosh
  • 76,898
  • 55
  • 205
  • 325
3
votes
3 answers

How to initialize a field in viewModel with suspend method

How to initialize a field in view model if I need to call the suspend function to get the value? I a have suspend function that returns value from a database. suspend fun fetchProduct(): Product When I create the view model I have to get product in…
3
votes
2 answers

Non suspend function is not executed after suspend function

I have a suspend function userRepo.updateUserWithNewPersonalDetails(details) and after executing this function I want to execute success() function which is a call back. but the issue is success() is not getting executed. any suggestions on how to…
BRDroid
  • 3,920
  • 8
  • 65
  • 143
3
votes
1 answer

Pausing a download thread

I'm writing a very simple bulk download program in c# that reads a .txt file of URLs to download. I've set it up with a global Thread and delegate for updating the GUI, and the pressing of the "Begin" button creates and starts that thread. What I…
Agni451
  • 31
  • 1
  • 2
3
votes
1 answer

How to combine results from a suspend function and a flow in kotlin?

Guys imagine I have these two sources of data: val flowA: Flow suspend fun funB(): Int How can I combine the result of both into a flow (let's say Flow>)? How about the approach below? Is there a better way? combine( …
Androider2
  • 427
  • 1
  • 5
  • 8
3
votes
2 answers

In Kotlin, is it possible to substitute a suspend fun with a non-suspend version, without breaking the caller?

I'm learning concurrency in Kotlin, coming from C#/JavaScript background, and I can't help comparing some concepts. In C# and JavaScript, technically we can rewrite an async function as a regular non-async version doing the same thing, using…
noseratio
  • 59,932
  • 34
  • 208
  • 486
3
votes
1 answer

Is it possible to suspend and restart tasks in async Python?

The question should be simple enough, but I couldn't find anything about it. I have an async Python program that contains a rather long-running task that I want to be able to suspend and restart at arbitrary points (arbitrary of course meaning…
thisisalsomypassword
  • 1,423
  • 1
  • 6
  • 17
3
votes
1 answer

How to call suspend function from another suspend function without blocking caller function?

I am calling an Api from a suspend function and after successful execution of it, I need to call another Api (which is also in another suspend function). suspend fun updateSubscription(body: Map):…
ahsanali274
  • 471
  • 2
  • 14
3
votes
1 answer

Android App: Suspended from Google Play due to Deceptive Behavior policy violation

We have a screen were we are taking credit card details and send that details using our web API, with AES encryption. Initial and second release was successfully accepted by google. Later when we deploy new version then they suspended app due to…
RaRa
  • 2,024
  • 1
  • 18
  • 29