Example #1
0
 /// <summary>
 /// Matching messages will be ensured to be published though the Dispatcher of this application. This is useful for messages that trigger
 /// UI activity
 /// </summary>
 public static MessagingConfiguration HandleTheseMessagesOnDispatcher(this MessagingConfiguration config, Func <MessageInfo, bool> predicate)
 {
     config.AddConfigurationArtefact(new UiMessages(predicate));
     return(config);
 }
Example #2
0
 /// <summary>
 /// Messages that match the predicate will be published without blocking te publisher
 /// </summary>
 public static MessagingConfiguration HandleTheseMessagesAsynchronously(this MessagingConfiguration config, Func <MessageInfo, bool> predicate)
 {
     config.AddConfigurationArtefact(new MessagingAsync(predicate));
     return(config);
 }
Example #3
0
 /// <summary>
 /// Types that match this predicate will be instantiated during application startup and will be subscribed to the
 /// bus instance. They may serve as message hubs for e.g. handling Commands and generating responses.
 /// </summary>
 public static MessagingConfiguration TypesBeingAMessageHub(this MessagingConfiguration config, Func <Type, bool> predicate)
 {
     config.MessageHubPredicates.Add(predicate);
     return(config);
 }
Example #4
0
 /// <summary>
 /// By default, methods named "Handle" are taken as subscriptions. Override this behavior
 /// to your liking
 /// </summary>
 public static MessagingConfiguration SpecifyFlexibleSubscriptionRules(this MessagingConfiguration config, Action <FlexibleSubscribeAdapter> subscribe)
 {
     config.SubscribeAdapterConfig = subscribe;
     return(config);
 }
Example #5
0
 /// <summary>
 /// When called, all types that are created through StructureMap and match the provided
 /// predicate will be subscribed to the Messaging bus. You can call this method several times.
 /// </summary>
 public static MessagingConfiguration TypesSubscribedToMessaging(this MessagingConfiguration config, Func <Type, bool> predicate)
 {
     config.MessagingHandlerPredicates.Add(predicate);
     return(config);
 }