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

Split Main & Streaming socket #18

Merged
merged 9 commits into from
Jan 2, 2024
Merged

Conversation

dsienkiewicz
Copy link
Owner

@dsienkiewicz dsienkiewicz commented Dec 28, 2023

Solves #8 , #10 and #11 .

Problem & solution

  1. Public API should return result tuples.
    Whenever public API functions are called, result should be formed as {:ok, struct()} or {:error, %Error{}} tuple.
  2. StreamingSocket module now is useable, which means it defines callbacks, which should be implemented on client side to receive streamed messages. It means there's no longer juggling of messages between streaming socket process and connection process - as connection process is no longer needed.
    It also means the management of main socket & streaming socket is up to client.
  3. With removal of connection process there's no issue with heavy init calls.

@dsienkiewicz dsienkiewicz added the enhancement New feature or request label Dec 28, 2023
@dsienkiewicz dsienkiewicz added this to the 0.2 milestone Dec 28, 2023
@dsienkiewicz dsienkiewicz self-assigned this Dec 28, 2023
@dsienkiewicz dsienkiewicz marked this pull request as ready for review January 2, 2024 23:01
@dsienkiewicz dsienkiewicz merged commit cc9bae6 into main Jan 2, 2024
1 check passed
@dsienkiewicz dsienkiewicz deleted the 10-make-connection-useable branch January 2, 2024 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Public API should return result tuples Make Connection useable Make init call on connections less heavy
1 participant