added iOS source code
[wl-app.git] / iOS / Pods / MatomoTracker / MatomoTracker / Queue.swift
1 import Foundation
2
3 public protocol Queue {
4     
5     var eventCount: Int { get }
6     
7     mutating func enqueue(events: [Event], completion: (()->())?)
8     
9     /// Returns the first `limit` events ordered by Event.date
10     func first(limit: Int, completion: (_ items: [Event])->())
11     
12     /// Removes the events from the queue
13     mutating func remove(events: [Event], completion: ()->())
14 }
15
16 extension Queue {
17     mutating func enqueue(event: Event, completion: (()->())? = nil) {
18         enqueue(events: [event], completion: completion)
19     }
20 }