Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add state (current state name) info field in gun:info/1 #293

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zuiderkwast
Copy link
Contributor

It's useful to be able to check the HTTP connection status (connected, closing, not connected, etc.). The current gen_statem state name provides exactly this info. This commit adds it to gun:info/1 under the key state.

@zuiderkwast
Copy link
Contributor Author

This one is waiting as well.

If you don't accept exposing the internal gen_statem states, then how about a variant with fewer states (e.g. connecting | connected | closing) instead of the full not_connected | domain_lookup | connecting | initial_tls_handshake | tls_handshake | connected | closing?

Or if you don't accept it at all, it's better to know that and close it.

@essen
Copy link
Member

essen commented Sep 26, 2023

Probably best to document it as atom() so they can be changed without it being a breaking change if necessary.

@essen
Copy link
Member

essen commented Oct 2, 2023

One final change, sorry I didn't think about this earlier. I think we should name the field state_name instead of state to avoid any unnecessary confusion with the process state.

bjosv pushed a commit to Nordix/gun that referenced this pull request Apr 2, 2024
bjosv pushed a commit to Nordix/gun that referenced this pull request Apr 3, 2024
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.

None yet

2 participants