using System;
using System.Linq;
namespace NzbDrone.Common.Eventing
{
///
/// Enables loosely-coupled publication of and subscription to events.
///
public interface IEventAggregator
{
///
/// Gets or sets the default publication thread marshaller.
///
///
/// The default publication thread marshaller.
///
Action PublicationThreadMarshaller { get; set; }
///
/// Subscribes an instance to all events declared through implementations of
///
/// The instance to subscribe for event publication.
void Subscribe(object instance);
///
/// Unsubscribes the instance from all events.
///
/// The instance to unsubscribe.
void Unsubscribe(object instance);
///
/// Publishes a message.
///
/// The message instance.
///
/// Uses the default thread marshaller during publication.
///
void Publish(object message);
///
/// Publishes a message.
///
/// The message instance.
/// Allows the publisher to provide a custom thread marshaller for the message publication.
void Publish(object message, Action marshal);
}
}