Table of Contents

Class SubscribeAttribute

Namespace
Silverback.Messaging.Subscribers
Assembly
Silverback.Core.dll

Used to identify the methods that have to be subscribed to the messages stream. The first parameter of the subscriber method always correspond to the message and must be declared with a type compatible with the message to be received (the message type, a base type or an implemented interface) or a collection of items of that type. The methods can be either synchronous or asynchronous (returning a Task) and don't need to be publicly visible.

[AttributeUsage(AttributeTargets.Method)]
public sealed class SubscribeAttribute : Attribute
Inheritance
SubscribeAttribute
Inherited Members

Constructors

SubscribeAttribute()

public SubscribeAttribute()

Properties

Exclusive

Gets or sets a value indicating whether the method can be executed concurrently to other methods handling the same message. The default value is true (the method will be executed sequentially to other subscribers).

public bool Exclusive { get; set; }

Property Value

bool