Skip to content

Releases: thedudxo/Venta

InterfaceEvents v2.0.1

12 Nov 03:05
9af6599
Compare
Choose a tag to compare
  • Resending an event after a subscriber threw an exception does not cause eventSender to throw a concurrent send exception.
  • added Subscribe(int priority, T item) overload. Shouldn't change anything for you as Subscribe(int priority, params T items[]) already exists.

InterfaceEvents v2.0.0

13 Oct 06:09
Compare
Choose a tag to compare

Breaking Changes:

  • sealed EventSender<T>
  • Send() throws ConcurrentSendException instead of InvalidOperationException
  • Removed deprecated EventSender<T>.EventSendMethod

no other functionality was modified.

Full Changelog: 1.5.0...2.0.0

InterfaceEvents v1.5

21 Apr 21:30
Compare
Choose a tag to compare
  • Improved error stack trace when a subscription request was delayed.
  • Added TrySubscribe() and TryUnsubscribe() methods. both return bools, and will not throw exceptions if the item is already un/subscribed.

InterfaceEvents v1.4

21 Apr 01:43
a93e8ea
Compare
Choose a tag to compare

Added Event Builder, used to set optional features.

This will create the default EventSender, same as using new EventSender():

EventSender<IOnEvent> myEvent = new EventBuilder<IOnEvent>()
            .Build();

Deprecated EventSendMethod enum and EvenSender.SendMethod property.
use the builder instead:

EventSender<IOnEvent> myEvent = new EventBuilder<IOnEvent>()
            .SendOnlyHighestPriority()
            .Build();

You can also set the priority dictionary using the builder:
.WithPriorityDictionary(priorities);


Only notify once

This option will only alow an event to be sent once. after which:

  • current subscribers are unsubscribed
  • new subscribers are not subscribed, but instead receive the event immediately

this means that the EventSender holds no references to the subscribers after the event has been sent, so they may be garbage collected.

this option is usefull for delaying the creation of dependant objects untill thier dependancies have been created.

trying to send the event multiple times will throw a System.InvalidOperationException.

EventSender<IOnEvent> myEvent = new EventBuilder<IOnEvent>()
            .SendOnlyOnce()
            .Build();

InterfaceEvents v1.3

20 Apr 20:32
Compare
Choose a tag to compare

Subscribe items to the same event in bulk.
Event.Subscribe(a, b);
Event.Subscribe(2, c, d, e);
Event.Unsubscribe(a, b, c, d, e);

InterfaceEvents v1.2

03 Apr 23:44
Compare
Choose a tag to compare

option to only notify subscribers with the highest priority.

MyEvent.SendMethod = EventSendMethod.OnlyHighestPriority;

InterfaceEvents v1.1

24 Mar 10:27
Compare
Choose a tag to compare

Type priority dictionaries let you specify what priority any instance of a type will be given when subscribing via eventSender.SubscribeByRegisteredType()

An item in the dictionary subscribed with eventSender.Subscribe() will throw an exception.

public class MyPriorityDictionary : PriorityDictionary
    {
        public MyPriorityDictionary()
        {
            Add<ClassA>(0);
            Add<ClassB>(After<ClassA>());
            Add<ClassC>(Before<ClassB>());
        }
    }
public EventSender<ISetup> myEvent = new EventSender<ISetup>(new MyPriorityDictionary());

InterfaceEvents v1.0

13 Dec 20:31
Compare
Choose a tag to compare
Removed unessceary = null