//
//  MessageReceiver.swift
//  Astro
//
//  Created by Mark Sandstrom on 4/23/15.
//  Copyright (c) 2015 Mobify Research & Development Inc. All rights reserved.
//

import Foundation

/// `AnyObject` that can receive messages from a `MessageBus`.
///
/// `MessageReceiver` is constrained to `class` types so that receivers can be
/// compared with the identity operator (`===`). This is needed to guard
/// against the same receiver listening to the same address multiple times.
///
/// You will almost always want to inherit from `BaseMessageReceiver` when
/// conforming to the `MessageReceiver` protocol.
protocol MessageReceiver: class {
    func receive(_ message: Message)
}
