Skip to content

Commit

Permalink
fix typo in closeAndAwaitTermination
Browse files Browse the repository at this point in the history
fix lint warnings
  • Loading branch information
kosyloa committed Dec 7, 2023
1 parent 180f5ab commit e725875
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 23 deletions.
10 changes: 5 additions & 5 deletions DXFeedFramework/Api/DXEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public class DXEndpoint {
/// This method does nothing if this endpoint is ``DXEndpointState/closed``
/// The endpoint ``getState()`` immediately becomes ``DXEndpointState/notConnected`` otherwise.
/// This method does not release all resources that are associated with this endpoint.
/// Use ``close()`` or ``closeAndAWaitTermination()`` methods to release all resources.
/// Use ``close()`` or ``closeAndAwaitTermination()`` methods to release all resources.
/// - Throws: GraalException. Rethrows exception from Java.recore
public func disconnect() throws {
try self.endpointNative.disconnect()
Expand All @@ -287,7 +287,7 @@ public class DXEndpoint {
/// This method does nothing if this endpoint is``DXEndpointState/closed``.
/// The endpoint``getState()`` immediately becomes``DXEndpointState/notConnected`` otherwise.
/// This method does not release all resources that are associated with this endpoint.
/// Use ``close()`` or ``closeAndAWaitTermination()`` methods to release all resources.
/// Use ``close()`` or ``closeAndAwaitTermination()`` methods to release all resources.
/// - Throws: GraalException. Rethrows exception from Java.recore
public func disconnectAndClear() throws {
try self.endpointNative.disconnectAndClear()
Expand All @@ -311,8 +311,8 @@ public class DXEndpoint {
///
/// This method ensures that ``DXEndpoint`` can be safely garbage-collected
/// when all outside references to it are lost.
public func closeAndAWaitTermination() throws {
try self.endpointNative.closeAndAWaitTermination()
public func closeAndAwaitTermination() throws {
try self.endpointNative.closeAndAwaitTermination()
}
/// Changes password for this endpoint.
/// This method shall be called before ``connect(_:)`` together
Expand Down Expand Up @@ -349,7 +349,7 @@ public class DXEndpoint {
/// Waits while this endpoint ``getState()`` becomes ``DXEndpointState/notConnected`` or
/// ``DXEndpointState/closed``. It is a signal that any files that were opened with
/// ``connect(_:)`` with parameter "file:..." method were finished reading, but not necessary were completely
/// processed by the corresponding subscription listeners. Use ``closeAndAWaitTermination()`` after
/// processed by the corresponding subscription listeners. Use ``closeAndAwaitTermination()`` after
/// this method returns to make sure that all processing has completed.
/// **This method is blocking.**
/// - Throws: GraalException. Rethrows exception from Java.recore
Expand Down
4 changes: 2 additions & 2 deletions DXFeedFramework/Events/Market/Candles/CandleAlignment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public enum CandleAlignment: DXCandleAlignment, CaseIterable {
attributeKey,
other.toString())
}
} catch let error { }
} catch _ { }
return symbol
}

Expand Down Expand Up @@ -146,7 +146,7 @@ extension CandleAlignment: ICandleSymbolProperty {
CandleAlignment.attributeKey,
self.toString())
return res
} catch let error { }
} catch _ { }
}
return symbol
}
Expand Down
2 changes: 1 addition & 1 deletion DXFeedFramework/Events/Market/Candles/CandlePeriod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class CandlePeriod {
attribute,
other.toString())
}
} catch let error { }
} catch _ { }
return symbol
}

Expand Down
2 changes: 1 addition & 1 deletion DXFeedFramework/Events/Market/Candles/CandlePrice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public enum CandlePrice: DXCandlePrice, CaseIterable {
if attribute != other.toString() {
return try MarketEventSymbols.changeAttributeStringByKey(symbol, attributeKey, other.toString())
}
} catch let error { }
} catch _ { }
return symbol
}
/// Gets candle price of the given candle symbol string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class CandlePriceLevel {
attributeKey,
other.toString())
}
} catch let error { }
} catch _ { }
return symbol
}

Expand Down
2 changes: 1 addition & 1 deletion DXFeedFramework/Events/Market/Candles/CandleSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public enum CandleSession: DXCandleSession, CaseIterable {
if other == false || other == nil {
_ = MarketEventSymbols.removeAttributeStringByKey(symbol, attributeKey)
}
} catch let error { }
} catch _ { }
return symbol
}
/// Gets candle session of the given candle symbol string.
Expand Down
2 changes: 1 addition & 1 deletion DXFeedFramework/Native/Endpoint/NativeEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class NativeEndpoint {
let thread = currentThread()
try ErrorCheck.nativeCall(thread, dxfg_DXEndpoint_close(thread, self.endpoint))
}
func closeAndAWaitTermination() throws {
func closeAndAwaitTermination() throws {
let thread = currentThread()
try ErrorCheck.nativeCall(thread, dxfg_DXEndpoint_closeAndAwaitTermination(thread, self.endpoint))
}
Expand Down
2 changes: 1 addition & 1 deletion Samples/PertTestApp/PerfTestViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class PerfTestViewController: UIViewController {

@IBAction func connectTapped(_ sender: Any) {
if isConnected {
try? endpoint?.closeAndAWaitTermination()
try? endpoint?.closeAndAwaitTermination()
subscription = nil
} else {
guard let address = addressTextField.text else {
Expand Down
8 changes: 4 additions & 4 deletions Samples/Playgrounds/ConvertTapeFile.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class Listener: DXEventListener, Hashable {
_ = overrides(self)
}
}

let pathComponents = [NSTemporaryDirectory(), "ConvertTapeFile.out"]
guard let inputFilePath = Bundle.main.path(forResource: "ConvertTapeFile.in", ofType: nil),
let outputFilePath = NSURL.fileURL(withPathComponents: [NSTemporaryDirectory(), "ConvertTapeFile.out"])?.path else {
let outputFilePath = NSURL.fileURL(withPathComponents: pathComponents)?.path else {
fatalError("Wrong path to output file")
}

Expand Down Expand Up @@ -87,11 +87,11 @@ try inputEndpoint.connect(inputAddress)

// Wait until all data is read and processed, and then gracefully close input endpoint.
try inputEndpoint.awaitNotConnected()
try inputEndpoint.closeAndAWaitTermination()
try inputEndpoint.closeAndAwaitTermination()

// Wait until all data is processed and written, and then gracefully close output endpoint.
try outputEndpoint.awaitProcessed()
try outputEndpoint.closeAndAWaitTermination()
try outputEndpoint.closeAndAwaitTermination()

print("""
ConvertTapeFile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ try endpoint.awaitNotConnected()

// Close endpoint when we're done.
// This method will gracefully close endpoint, waiting while data processing completes.
try endpoint.closeAndAWaitTermination()
try endpoint.closeAndAwaitTermination()
5 changes: 3 additions & 2 deletions Samples/Playgrounds/WriteTapeFile.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ let endpoint = try DXEndpoint.builder()
.withRole(.publisher)
.build()

guard let outputFilePath = NSURL.fileURL(withPathComponents: [NSTemporaryDirectory(), "WriteTapeFile.out.txt"])?.path else {
let pathComponents = [NSTemporaryDirectory(), "WriteTapeFile.out.txt"]
guard let outputFilePath = NSURL.fileURL(withPathComponents: pathComponents)?.path else {
fatalError("Wrong path to output file")
}

Expand All @@ -36,7 +37,7 @@ try publisher?.publish(events: [quote1, quote2])

// Wait until all data is written, close, and wait until it closes.
try endpoint.awaitProcessed()
try endpoint.closeAndAWaitTermination()
try endpoint.closeAndAwaitTermination()

// Just print content of result file
let resultTxtFile = try NSString(contentsOf: URL(filePath: outputFilePath), encoding: NSUTF8StringEncoding)
Expand Down
4 changes: 3 additions & 1 deletion Samples/QdsTools/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
func scene(_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
guard let _ = (scene as? UIWindowScene) else { return }
}

Expand Down
4 changes: 2 additions & 2 deletions Samples/Tools/DumpTool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ class DumpTool: ToolsCommand {
try inputEndpoint.connect(address)

try inputEndpoint.awaitNotConnected()
try inputEndpoint.closeAndAWaitTermination()
try inputEndpoint.closeAndAwaitTermination()

try outputEndpoint?.awaitProcessed()
try outputEndpoint?.closeAndAWaitTermination()
try outputEndpoint?.closeAndAwaitTermination()
} catch {
print("Dump tool error: \(error)")
}
Expand Down

0 comments on commit e725875

Please sign in to comment.