내용으로 건너뛰기

Interrupt async call: Is it not supported in aws cpp sdk?

0

Hi,

I'm using aws cpp sdk to do some async call, specifically sqs->receiveMessagesAsync. However, I can't find a way to interrupt the call in the middle.

I looked up for documentation that quote "However, the client object must continue to exist until the asynchronous operation finishes" in sdk-for-cpp. I am looking for something that looks like the function checkInterrupted in java sdk.

So, could you add support for interrupt async call in aws-sdk-cpp?

1개 답변
0

Correct, there are no interrupts for this in the C++ sdk. Interrupts in C++ are generally bad and cause some bad undefined behaviors.

You can try to abort the call in in the middle by using "ContinueRequestHandler". Here is an example that being used in one of our tests.

답변함 2년 전

  • Thanks for the reply!

    However, I tried to use your recommended "ContinueRequestHandler", for the operation sqs->receiveMessagesAsync. The responding speed didn't change at all, and I believe it's still waiting for 20s for the long polling to end. Is there a better solution to this?

  • You can try setting a more aggressive timeout to decrease the amount of time that you're waiting. Sorry that there isn't a better solution.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠