DotNetBrightener.Plugins.EventPubSub 2025.0.10

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package DotNetBrightener.Plugins.EventPubSub --version 2025.0.10
                    
NuGet\Install-Package DotNetBrightener.Plugins.EventPubSub -Version 2025.0.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotNetBrightener.Plugins.EventPubSub" Version="2025.0.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetBrightener.Plugins.EventPubSub" Version="2025.0.10" />
                    
Directory.Packages.props
<PackageReference Include="DotNetBrightener.Plugins.EventPubSub" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotNetBrightener.Plugins.EventPubSub --version 2025.0.10
                    
#r "nuget: DotNetBrightener.Plugins.EventPubSub, 2025.0.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DotNetBrightener.Plugins.EventPubSub@2025.0.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotNetBrightener.Plugins.EventPubSub&version=2025.0.10
                    
Install as a Cake Addin
#tool nuget:?package=DotNetBrightener.Plugins.EventPubSub&version=2025.0.10
                    
Install as a Cake Tool

Event Publish/Subscribe Library

© DotNet Brightener

NuGet Version

Usage

Event message

Event message is a message that would be emitted by the IEventPublisher. The IEventHandler for the message will be proceeded sequentially, and will be stopped if the higher-prioritized handler tells the next one to stop by returning false in its HandleEvent method.

public class YourEventMessage: IEventMessage 
{
	// your model goes here
}
Non-Stopped event message

Non-stopped event message is the type of IEventMessage that will be handled by all the handlers regardless the result from the process of each handler.

public class YourEventMessage: INonStoppedEventMessage 
{
	// your model goes here
}
Define event handler

Define an event handler to process the event emitted by the IEventPublisher service as follow:

public class YourEventModelEventHandler: IEventHandler<YourEventMessage>
{
	// the higher number will tell the publisher to execute before the others
	public int Priority { get; } => 10;

	public async Task<bool> HandleEvent(YourEventMessage eventMessage) 
	{
		// do something with your eventMessage

		// if YourEventModel implements INonStoppedEventMessage, 
		// regardless the next statement, 
		// the next handler will continue to process in parallel

		// if you want to let the next handler to process the message
		return true;

		// otherwise, return false here;
		// return false;
	}
}

Emit the event

Inject IEventPublisher to your controller / service class and use it as follow:


public class SomeService 
{
	private readonly IEventPublisher _eventPublisher;
	// other services

	public SomeService(IEventPublisher eventPublisher, 
						// other services
						)
	{
		_eventPublisher = eventPublisher;
	}

	public async Task SomeMethod() 
	{
		var eventMessage = new YourEventMessage
		{
			// the event content
		};

		// if you want to let the event message to be processed in the current thread
		await _eventPublisher.Publish(eventMessage);

		// if you want to let the event message to be processed in the another thread
		await _eventPublisher.Publish(eventMessage, true);
	}
}

Register at startup

You will need to install the package DotNetBrightener.Plugins.EventPubSub.DependencyInjection from nuget.org and follow instruction there.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (11)

Showing the top 5 NuGet packages that depend on DotNetBrightener.Plugins.EventPubSub:

Package Downloads
DotNetBrightener.Core.BackgroundTasks

Package Description

DotNetBrightener.Plugins.EventPubSub.DependencyInjection

Package Description

DotNetBrightener.SimpleUploadService

A Simple Upload API for ASP.NET Core Applications

DotNetBrightener.Infrastructure.ApiKeyAuthentication

Package Description

DotNetBrightener.WebApp.CommonShared

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.0.1-preview-notificati... 215 12/6/2025
2026.0.1-preview-net10-upgr... 268 11/25/2025
2026.0.1-preview-net10-upgr... 265 11/25/2025
2026.0.1-preview-net10-upgr... 267 11/24/2025
2026.0.1-preview-net10-upgr... 389 11/24/2025
2026.0.1-preview-731 76 2/3/2026
2026.0.1-preview-728 194 1/20/2026
2026.0.1-preview-723 177 1/15/2026
2026.0.1-preview-721 185 1/15/2026
2026.0.1-preview-717 197 1/5/2026
2026.0.1-preview-713 548 12/10/2025
2026.0.1-preview-700 308 12/7/2025
2026.0.1-preview-689 196 12/6/2025
2026.0.1-preview-676 766 12/2/2025
2026.0.1-preview-671 203 11/29/2025
2026.0.1-preview-670 187 11/29/2025
2026.0.1-preview-669 204 11/29/2025
2026.0.1-preview-667 262 11/27/2025
2026.0.1-preview-665 263 11/27/2025
2026.0.1-preview-664 259 11/27/2025
2026.0.1-preview-660 261 11/25/2025
2025.0.10 345 11/25/2025
2025.0.10-preview-628 537 11/20/2025
2025.0.10-preview-605 415 11/17/2025
2025.0.10-preview-602 420 11/17/2025
2025.0.10-preview-581 435 11/11/2025
2025.0.10-preview-559 327 10/29/2025
2025.0.10-preview-557 325 10/27/2025
2025.0.9 336 10/26/2025
2025.0.9-preview-553 310 10/26/2025
2025.0.9-preview-539 261 10/12/2025
2025.0.9-preview-535 313 10/8/2025
2025.0.9-preview-509 331 10/2/2025
2025.0.9-preview-508 312 10/2/2025
2025.0.9-preview-487 338 9/29/2025
2025.0.9-preview-481 349 9/29/2025
2025.0.9-preview-473 298 9/28/2025
2025.0.8 378 9/23/2025
2025.0.6 362 9/22/2025
2025.0.6-preview-455 348 9/22/2025
2025.0.6-preview-454 431 9/17/2025
2025.0.6-preview-441 263 9/14/2025
2025.0.6-preview-440 274 9/14/2025
2025.0.6-preview-406 311 9/2/2025
2025.0.6-preview-401 289 9/2/2025
2025.0.6-preview-400 289 9/2/2025
2025.0.6-preview-369 350 8/27/2025
2025.0.6-preview-368 335 8/27/2025
2025.0.6-preview-334 316 8/18/2025
2025.0.6-preview-333 251 7/27/2025
2025.0.6-preview-332 583 7/24/2025
2025.0.6-preview-331 592 7/24/2025
2025.0.6-preview-328 584 7/24/2025
2025.0.6-preview-327 494 7/21/2025
2025.0.6-preview-326 494 7/21/2025
2025.0.6-preview-325 393 7/20/2025
2025.0.6-preview-324 382 7/20/2025
2025.0.6-preview-322 378 7/20/2025
2025.0.6-preview-321 376 7/19/2025
2025.0.6-preview-320 397 7/19/2025
2025.0.6-preview-319 300 7/17/2025
2025.0.6-preview-317 289 7/17/2025
2025.0.6-preview-316 305 7/17/2025
2025.0.6-preview-315 300 7/17/2025
2025.0.6-preview-314 290 7/17/2025
2025.0.6-preview-313 285 7/17/2025
2025.0.6-preview-312 309 7/16/2025
2025.0.5 325 7/10/2025
2025.0.5-preview-307 253 7/5/2025
2025.0.4 240 7/5/2025
2025.0.4-preview-305 236 7/4/2025
2025.0.4-preview-304 313 7/1/2025
2025.0.4-preview-299 308 5/31/2025
2025.0.4-preview-298 261 5/30/2025
2025.0.4-preview-296 307 5/30/2025
2025.0.4-preview-295 313 5/29/2025
2025.0.4-preview-293 321 5/26/2025
2025.0.4-preview-292 331 5/26/2025
2025.0.3 330 2/10/2025
2025.0.3-preview-288 297 2/10/2025
2025.0.2 325 1/21/2025
2025.0.2-preview-278 289 1/21/2025
2025.0.2-preview-277 291 12/16/2024
2025.0.1-rc-243301701 688 11/25/2024
2024.0.14.6 359 11/25/2024
2024.0.14.6-rc-243031001 410 10/29/2024
2024.0.14.6-rc-243030701 364 10/29/2024
2024.0.14.6-rc-242840501 334 10/10/2024
2024.0.14.6-rc-242820305 345 10/8/2024
2024.0.14.6-rc-242771401 529 10/3/2024
2024.0.14.6-rc-242770501 318 10/3/2024
2024.0.14.6-rc-242770201 351 10/3/2024
2024.0.14.6-rc-242761801 323 10/2/2024
2024.0.14.6-rc-242761601 370 10/2/2024
2024.0.14.6-rc-242761501 329 10/2/2024
2024.0.14.6-rc-242761401 352 10/2/2024
2024.0.14.6-rc-242760701 355 10/2/2024
2024.0.14.6-rc-242751002 355 10/1/2024
2024.0.14.6-rc-242750901 377 10/1/2024
2024.0.14.6-rc-242750502 357 10/1/2024
2024.0.14.6-rc-242750201 380 10/1/2024
2024.0.14.6-rc-242741501 363 9/30/2024
2024.0.14.6-rc-242730701 367 9/29/2024
2024.0.14.6-preview-2730501 319 9/29/2024
2024.0.14.6-preview-2701501 355 9/26/2024
2024.0.14.6-preview-2620901 376 9/18/2024
2024.0.14.6-preview-2570701 378 9/13/2024
2024.0.14.6-preview-2510703 446 9/7/2024
2024.0.14.6-preview-2480501 461 9/4/2024
2024.0.14.6-preview-2430401 402 8/30/2024
2024.0.14.6-preview-242730701 344 9/29/2024
2024.0.14.6-preview-2421703 349 8/29/2024
2024.0.14.6-preview-2421701 332 8/29/2024
2024.0.14.6-preview-2420901 336 8/29/2024
2024.0.14.6-preview-2390101 360 8/26/2024
2024.0.14.6-preview-2381603 341 8/25/2024
2024.0.14.6-preview-2341601 368 8/21/2024
2024.0.14.6-preview-2321602 336 8/20/2024
2024.0.14.6-preview-2190801 353 8/6/2024
2024.0.14.6-preview-2041501 322 7/22/2024
2024.0.14.6-preview-1920603 382 7/10/2024
2024.0.14.6-preview-1920301 315 7/10/2024
2024.0.14.6-preview-1911302 319 7/9/2024
2024.0.14.6-preview-1901001 321 7/8/2024
2024.0.14.6-preview-1900901 285 7/8/2024
2024.0.14.6-preview-1900801 329 7/8/2024
2024.0.14.6-preview-1860304 291 7/4/2024
2024.0.14.5 413 7/1/2024
2024.0.14.5-preview-1811601 348 6/29/2024
2024.0.14.5-preview-1810501 350 6/29/2024
2024.0.14.5-preview-180132 355 6/28/2024
2024.0.14.5-preview-180131 316 6/28/2024
2024.0.14.5-preview-180121 311 6/28/2024
2024.0.14.4 432 6/27/2024
2024.0.14.4-preview-7 339 6/27/2024
2024.0.14.3 353 6/21/2024
2024.0.14.1 340 6/6/2024
2024.0.14.1-preview 307 6/6/2024
2024.0.14-preview-1 285 6/6/2024
2024.0.13.8-preview 363 6/6/2024
2024.0.13.1-preview-0146 377 6/6/2024
2024.0.12.15803-preview-03 327 6/6/2024
2024.0.12.15608 347 6/4/2024
2024.0.12.15515 422 6/3/2024
2024.0.12.15220 344 5/31/2024
2024.0.12.15220-alpha31-240... 301 5/31/2024
2024.0.12.14911 389 5/28/2024
2024.0.12.14910-alpha28-240... 335 5/28/2024
2024.0.12.14823 345 5/27/2024
2024.0.12.14522-alpha7-2405... 322 5/24/2024
2024.0.12.14514-alpha6-2405... 316 5/24/2024
2024.0.12.14511 355 5/24/2024
2024.0.12.14314 397 5/22/2024
2024.0.12.14114 500 5/20/2024
2024.0.12.12815 504 5/7/2024
2024.0.12.12814 457 5/7/2024
2024.0.12.12721 471 5/6/2024
2024.0.12.12702 454 5/5/2024
2024.0.12.12622 455 5/5/2024
2024.0.12.12514 445 5/4/2024
2024.0.12.12512 448 5/4/2024
2024.0.12.12510 442 5/4/2024
2024.0.12.12420 420 5/3/2024
2024.0.12.12319 395 5/2/2024
2024.0.12.12319-rc-2405021801 350 5/2/2024
2024.0.12.12318 365 5/2/2024
2024.0.12.12215 419 5/1/2024
2024.0.12.12011 374 4/29/2024
2024.0.12.11720 379 4/26/2024
2024.0.12.11719 377 4/26/2024
2024.0.12.11621 414 4/25/2024
2024.0.12.11523 417 4/24/2024
2024.0.12.11522 404 4/24/2024
2024.0.12.11417 390 4/23/2024
2024.0.12.11400 382 4/22/2024
2024.0.12.11316 374 4/22/2024
2024.0.11.10220 332 4/11/2024
2024.0.11.10120 315 4/10/2024
2024.0.11.10119 289 4/10/2024
2024.0.11.10115 313 4/10/2024
2024.0.11.9914 334 4/8/2024
2024.0.11.9901 338 4/7/2024
2024.0.11.9823 342 4/7/2024
2024.0.11.9401 329 4/2/2024
2024.0.11.9301 354 4/1/2024
2024.0.11.9206 304 3/31/2024
2024.0.11.9205 335 3/31/2024
2024.0.11.8200 350 3/21/2024
2024.0.11.8122 313 3/21/2024
2024.0.11.8120 337 3/21/2024
2024.0.11.7320 381 3/13/2024
2024.0.11.7316 334 3/13/2024
2024.0.11.7310 345 3/13/2024
2024.0.11 332 3/13/2024
2024.0.10 353 3/3/2024
2024.0.9 359 2/27/2024
2024.0.8 408 2/1/2024
2024.0.7 341 1/26/2024
2024.0.6 329 1/25/2024
2024.0.5 319 1/24/2024
2024.0.4 321 1/24/2024
2024.0.3 330 1/22/2024
2024.0.2 381 1/10/2024
2024.0.1 335 1/9/2024
2024.0.1-alpha-3 313 1/9/2024
2024.0.1-alpha-2 329 1/9/2024
2024.0.1-alpha-1 344 1/3/2024
2024.0.0 397 12/26/2023
2023.0.27 442 12/21/2023
2023.0.26 391 12/21/2023
2023.0.25 462 12/11/2023
2023.0.24 447 12/8/2023
2023.0.23 424 12/6/2023
2023.0.21 502 12/4/2023
2023.0.20 483 11/27/2023
2023.0.19 407 11/20/2023
2023.0.18 456 10/25/2023
2023.0.17 493 10/22/2023
2023.0.16 479 10/16/2023
2023.0.16-alpha-1 364 10/16/2023
2023.0.15 428 10/14/2023
2023.0.14 400 10/14/2023
2023.0.13 387 10/14/2023
2023.0.12 407 10/14/2023
2023.0.11 402 10/10/2023
2023.0.10 407 10/9/2023
2023.0.9 576 8/16/2023
2023.0.8 482 8/15/2023
2023.0.8-alpha-2 579 5/31/2023
2023.0.7 533 5/12/2023
2023.0.6 726 5/10/2023
2023.0.5 544 5/7/2023
2023.0.4 584 4/22/2023
2023.0.3 600 4/19/2023
2023.0.2 615 4/6/2023
2023.0.1 605 3/13/2023
2022.11.0 580 11/21/2022
2022.10.2 469 11/21/2022
2022.10.0 1,978 10/15/2022
2022.9.0 653 9/5/2022
2021.10.1 663 10/17/2021
1.0.0 712 1/19/2021