Asyncio task fire and forget

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
nelfata
 
Posts: 31
Joined: Wed May 07, 2014 9:44 am

Asyncio task fire and forget

Post by nelfata »

Hello,
I am trying to create an asyncio task, fire and forget style. The task is starting but the call to

Code: Select all

await asyncio.sleep(0.1)
always defaults to 1 second.
I can't say I am an expert in asyncio but I think there is a bug in the asyncio library. The create_task() function does not seem to be adding the task onto the event loop properly.
Any thoughts?

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Asyncio task fire and forget

Post by danhalbert »

Could you please post your whole program or a simplified example that illustrates the problem?

User avatar
nelfata
 
Posts: 31
Joined: Wed May 07, 2014 9:44 am

Re: Asyncio task fire and forget

Post by nelfata »

I am sorry, it was a problem with my system, thank you for your prompt response.

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Asyncio task fire and forget

Post by danhalbert »

Glad you've figured it out!

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”