 				eventType = .stop
 			case "unpause":
 				eventType = .unpause
+			case "volume":
+				eventType = .volume
 			default:
 				return nil
 		}

	init(baseUrl: URL, delegate: DockerEventMonitorDelegate, sessionConfig: URLSessionConfiguration)
}

final class DockerEventMonitorImpl: NSObject, DockerEventMonitor, URLSessionDataDelegate {
	weak var delegate: DockerEventMonitorDelegate?
	var session: URLSession!

	required init(baseUrl: URL, delegate: DockerEventMonitorDelegate, sessionConfig: URLSessionConfiguration)
	{
		self.delegate = delegate
		super.init()
		sessionConfig.timeoutIntervalForRequest = TimeInterval(60 * 60 * 24) //wait a day
		session = URLSession(configuration: sessionConfig, delegate: self, delegateQueue:nil)
		let ourBaseUrl = URL(string: "/events", relativeTo: baseUrl)!
		var lcomponents = URLComponents(url: ourBaseUrl, resolvingAgainstBaseURL: true)!
		lcomponents.scheme = DockerUrlProtocol.streamScheme
		var request = URLRequest(url: lcomponents.url!)
		request.isHijackedResponse = true
		let task = session.dataTask(with: request as URLRequest)
//FIXME: 		task.resume()
	}

	open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
	{
		completionHandler(Foundation.URLSession.ResponseDisposition.allow)
	}

	open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
		let str = String(data: data, encoding:String.Encoding.utf8)!
		let messages = str.components(separatedBy: "\n")
		for aMessage in messages {
			guard !aMessage.characters.isEmpty else { continue }
			guard let jsonData = aMessage.data(using: .utf8), let json = try? JSON(data: jsonData) else {
				os_log("failed to parse json: %{public}@", log: .docker, aMessage)
				continue
			}
			if let event = DockerEvent(json) {
				os_log("got event: %{public}@", log:.dockerEvt, type:.info, event.description)
				delegate?.handleEvent(event)
			}
		}
	}

	open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
		os_log("why did our session end?: %{public}@", log: .docker, error as NSError? ?? "unknown")
		delegate?.eventMonitorClosed(error: error)
	}
}

	case stop
	case start
	case unpause
	case volume
}

struct DockerEvent: CustomStringConvertible {
