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 ability to instance socket connection in order to test multiple connections #127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ConnorRigby
Copy link
Contributor

No description provided.


@doc """
Send an update status to web
"""
@spec send_update_status(String.t() | atom()) :: :ok
defdelegate send_update_status(status), to: Socket
def send_update_status(status), do: Socket.send_update_status(Socket, status)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def send_update_status(status), do: Socket.send_update_status(Socket, status)
defdelegate send_update_status(socket \\ Socket, status), to: Socket

I'm pretty sure you can delegate the default and it would work with dialyzer as well

@spec reconnect() :: :ok
defdelegate reconnect(), to: Socket
@spec reconnect_socket() :: :ok
def reconnect_socket(), do: Socket.reconnect_socket(Socket)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason for this change? This could be considered breaking since reconnect() has been around a while

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah use Slipstream imports a reconnect/2 function. We could make NervesHubLink.reconnect stay the same while the socket module remains the new function.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a load test file. This is basic enough that those testing can implement what they need and we can skip adding a file thats not used in production

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