Review async & RwLock usage #54

Open
opened 2024-03-31 13:55:53 -04:00 by modulatingforce · 0 comments

Initial Description

Review async and RwLock usage in bot

I think I may have misunderstood RwLock & async and/or previously encountered obstacles I have since learned more from.

When I await , as I believe is documented, I'm yielding control to the scheduler to handle the future. If I don't require that particular type of async multitasking, and require a blocking operation, I should not await but try to use blocking related methods

Most scenarios should be blocking if the blocking is likely relatively short. For example, I expect this for simple methods or even custom fn.

Other scenarios that require blocking is one that require several modifications, but should be considered one update


Plan of Action

  • review opportunities to use blocking methods instead of async awaits in the newer feature set about Routines - in particular related to PR #51
  • if there are observed benefits with this review for Routines, may want to do the same for existing Listener and BotCommand
# Initial Description Review `async` and `RwLock` usage in bot I think I may have misunderstood `RwLock` & `async` and/or previously encountered obstacles I have since learned more from. When I `await` , as I believe is documented, I'm yielding control to the scheduler to handle the `future`. If I don't require that particular type of `async` multitasking, and require a blocking operation, I should not `await` but try to use blocking related methods Most scenarios should be blocking if the blocking is likely relatively short. For example, I expect this for simple methods or even custom fn. Other scenarios that require blocking is one that require several modifications, but should be considered one update --- # Plan of Action - [ ] review opportunities to use blocking methods instead of `async` awaits in the newer feature set about Routines - in particular related to PR https://git.flake.sh/modulatingforce/forcebot_rs/pulls/51 - [ ] if there are observed benefits with this review for Routines, may want to do the same for existing `Listener` and `BotCommand`
modulatingforce self-assigned this 2024-03-31 13:55:53 -04:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: modulatingforce/forcebot_rs#54
No description provided.