Skip to content

Comments

A more flexible handler API and supervisor-friendly start function#21

Merged
cyteon merged 7 commits intocyteon:mainfrom
vshakitskiy:new_api
Sep 27, 2025
Merged

A more flexible handler API and supervisor-friendly start function#21
cyteon merged 7 commits intocyteon:mainfrom
vshakitskiy:new_api

Conversation

@vshakitskiy
Copy link
Contributor

@vshakitskiy vshakitskiy commented Sep 25, 2025

#20

Didn't do any test cases related to WebSocket restarts, uses of stop or stop abnormal yet. Technically everything should work. I added some new functions and types to root module, and also adjusted example bot to have start for handler with state and custom message. You can try things out switching simple handler and "normal" handler. Don't really like the names, so maybe you have better ideas :D

@vshakitskiy
Copy link
Contributor Author

  • On discord_gleam.stop, event loop actor will still remain alive, meaning it wont be restarted by supervision tree, while discord websocket connection will be closed, as we want it to be closed.

  • On discord_gleam.stop_abnormal, actor will also stop abnormal. Since in example bot our actor is being part of supervision tree, actor with websocket connection is being successfully restarted.

I guess next functions works like I intended, but I still don't know about how correct does websocket reconnection logic work inside event loop actor

@cyteon
Copy link
Owner

cyteon commented Sep 25, 2025

Testing this tmrw then merging

@cyteon cyteon merged commit 43a7904 into cyteon:main Sep 27, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants