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

Improve read and write #10

Merged
merged 9 commits into from
Nov 12, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Write and read queues in protocol
  • Loading branch information
vadymmarkov committed Nov 11, 2015
commit b8ace78ded7a3bc067b277bca9b6b5598b92b0ac
2 changes: 2 additions & 0 deletions Source/CacheAware.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ public protocol CacheAware {
static var prefix: String { get }
var path: String { get }
var maxSize: UInt { get set }
var writeQueue: dispatch_queue_t { get }
var readQueue: dispatch_queue_t { get }

init(name: String)

Expand Down
3 changes: 2 additions & 1 deletion Source/MemoryCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
public class MemoryCache: CacheAware {

public static let prefix = "no.hyper.Cache.Memory"
public let ioQueueName = "no.hyper.Cache.Disk.IOQueue."


public var path: String {
return cache.name
Expand All @@ -16,6 +16,7 @@ public class MemoryCache: CacheAware {
}

public let cache = NSCache()


// MARK: - Initialization

Expand Down