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

v6.0.0 - Additional refactoring for better event and exception management. #30

Merged
merged 13 commits into from
May 22, 2023

Conversation

acupofjose
Copy link
Collaborator

@acupofjose acupofjose commented May 21, 2023

  • The realtime client now takes a "fail-fast" approach. On establishing an initial connection, client will throw
    a RealtimeException in ConnectAsync() if the socket server is unreachable. After an initial connection has been
    established, the client will continue attempting reconnections indefinitely until disconnected.
  • [Major, New] C# EventHandlers have been changed to delegates. This should allow for cleaner event data access over
    the previous subclassed EventArgs setup. Events are scoped accordingly. For example, the RealtimeSocket error
    handlers will receive events regarding socket connectivity; whereas the RealtimeChannel error handlers will receive
    events according to Channel joining/leaving/etc. This is implemented with the following methods prefixed by (
    Add/Remove/Clear):
    • RealtimeBroadcast.AddBroadcastEventHandler
    • RealtimePresence.AddPresenceEventHandler
    • RealtimeSocket.AddStateChangedHandler
    • RealtimeSocket.AddMessageReceivedHandler
    • RealtimeSocket.AddHeartbeatHandler
    • RealtimeSocket.AddErrorHandler
    • RealtimeClient.AddDebugHandler
    • RealtimeClient.AddStateChangedHandler
    • RealtimeChannel.AddPostgresChangeHandler
    • RealtimeChannel.AddMessageReceivedHandler
    • RealtimeChannel.AddErrorHandler
    • Push.AddMessageReceivedHandler
  • [Major, new] ClientOptions.Logger has been removed in favor of Client.AddDebugHandler() which allows for
    implementing custom logging solutions if desired.
    • A simple logger can be set up with the following:
    client.AddDebugHandler((sender, message, exception) => Debug.WriteLine(message));
  • [Major] Connect() has been marked Obsolete in favor of ConnectAsync()
  • Custom reconnection logic has been removed in favor of using the built-in logic from Websocket.Client@4.6.1.
  • Exceptions that are handled within this library have been marked as RealtimeExceptions.
  • The local, docker-composed test suite has been brought back (as opposed to remotely testing on live supabase servers)
    to test against.
  • Comments have been added throughout the entire codebase and an XML file is now generated on build.

@acupofjose acupofjose changed the title Additional refactoring for better event and exception management. v6.0.0 - Additional refactoring for better event and exception management. May 21, 2023
@acupofjose acupofjose marked this pull request as ready for review May 22, 2023 19:06
@acupofjose acupofjose merged commit 0ad48e6 into master May 22, 2023
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.

1 participant