Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
145 views
in Technique[技术] by (71.8m points)

c# - API async method call acting as eventHandler

I have a scenario where I need to ensure the following :

  1. UI, on button click makes a GET call to an API and waits for a response.
  2. API method has to perform two tasks X and Y on the GET request, but it should return X's response as soon as it gets it and performs Y in the background.
  3. UI is not aware if Y succeeds or not.

The challenge I am facing is returning a response back for X and at the same time triggering Y in parallel. Any safe thread pattern that can be followed here?

question from:https://stackoverflow.com/questions/65829533/api-async-method-call-acting-as-eventhandler

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...