Skip to content

Commit 4cd9b83

Browse files
author
Guilherme Souza
committed
Rename Realtime to RealtimeClientV2
1 parent f73cbc6 commit 4cd9b83

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

Sources/Realtime/Channel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public actor RealtimeChannelV2 {
2323
case unsubscribing
2424
}
2525

26-
weak var socket: Realtime? {
26+
weak var socket: RealtimeClientV2? {
2727
didSet {
2828
assert(oldValue == nil, "socket should not be modified once set")
2929
}
@@ -44,7 +44,7 @@ public actor RealtimeChannelV2 {
4444
init(
4545
topic: String,
4646
config: RealtimeChannelConfig,
47-
socket: Realtime
47+
socket: RealtimeClientV2
4848
) {
4949
_status = CurrentValueSubject(.unsubscribed)
5050
status = _status.share().eraseToAnyPublisher()

Sources/Realtime/RealtimeClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct StateChangeCallbacks {
5454
/// The `RealtimeClient` constructor takes the mount point of the socket,
5555
/// the authentication params, as well as options that can be found in
5656
/// the Socket docs, such as configuring the heartbeat.
57-
@available(*, deprecated, message: "Use new Realtime class instead.")
57+
@available(*, deprecated, message: "Use new RealtimeClientV2 class instead.")
5858
public class RealtimeClient: PhoenixTransportDelegate {
5959
// ----------------------------------------------------------------------
6060

Sources/Realtime/Realtime.swift renamed to Sources/Realtime/RealtimeClientV2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public protocol AuthTokenProvider: Sendable {
1414
func authToken() async -> String?
1515
}
1616

17-
public actor Realtime {
17+
public actor RealtimeClientV2 {
1818
public struct Configuration: Sendable {
1919
var url: URL
2020
var apiKey: String

Sources/Supabase/SupabaseClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public final class SupabaseClient: @unchecked Sendable {
4444
/// Realtime client for Supabase
4545
public let realtime: RealtimeClient
4646

47-
public lazy var realtimeV2: Realtime = .init(
48-
config: Realtime.Configuration(
47+
public lazy var realtimeV2: RealtimeClientV2 = .init(
48+
config: RealtimeClientV2.Configuration(
4949
url: supabaseURL.appendingPathComponent("/realtime/v1"),
5050
apiKey: supabaseKey,
5151
authTokenProvider: self

Tests/RealtimeTests/RealtimeTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ final class RealtimeTests: XCTestCase {
1717
func testConnect() async {
1818
let mock = MockWebSocketClient(status: [.success(.open)])
1919

20-
let realtime = Realtime(
21-
config: Realtime.Configuration(url: url, apiKey: apiKey, authTokenProvider: nil),
20+
let realtime = RealtimeClientV2(
21+
config: RealtimeClientV2.Configuration(url: url, apiKey: apiKey, authTokenProvider: nil),
2222
makeWebSocketClient: { _ in mock }
2323
)
2424

@@ -33,8 +33,8 @@ final class RealtimeTests: XCTestCase {
3333
func testChannelSubscription() async throws {
3434
let mock = MockWebSocketClient(status: [.success(.open)])
3535

36-
let realtime = Realtime(
37-
config: Realtime.Configuration(url: url, apiKey: apiKey, authTokenProvider: nil),
36+
let realtime = RealtimeClientV2(
37+
config: RealtimeClientV2.Configuration(url: url, apiKey: apiKey, authTokenProvider: nil),
3838
makeWebSocketClient: { _ in mock }
3939
)
4040

Tests/RealtimeTests/_PushTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import XCTest
1010

1111
final class _PushTests: XCTestCase {
12-
let socket = Realtime(config: Realtime.Configuration(
12+
let socket = RealtimeClientV2(config: RealtimeClientV2.Configuration(
1313
url: URL(string: "https://localhost:54321/v1/realtime")!,
1414
apiKey: "apikey",
1515
authTokenProvider: nil

0 commit comments

Comments
 (0)