Code Monkey home page Code Monkey logo

redbus's People

Contributors

mxjones avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redbus's Issues

Split out implementation and interfaces into a separate packages

It would be great to have a separate package for Interfaces (e.g. Redbus.Abstractions). The main need I have for this is that I want my domain project to have a reference to Redbus.Abstractions package but don't want it to have a reference to concrete implementation of the event bus so that it prevents direct coupling to the implementation.

I am happy to contribute this but wanted to check with you first to see if this would be something you are up to having.

No messages received with wrapped method

Hi, I found an issue that if you have for example this wrapper:

private static readonly IEventBus EventBus;

public static void Publish(EventBase message)
{
      EventBus.Publish(message);
}

// in another class

EventBusWrapper.Publish(new Payload(payload))

EventBus cannot find any event except EventBase.

But if you declare the method as below, everything works as should:

public static void Publish<T>(T message) where T : EventBase
{
      EventBus.Publish(message);
}

I spent a few hours to find a root cause. Maybe it saves time for others.

Exception : Collection has changed while changing it

Hi,

Thanks for your work, but there is an issue in EventBus, where you use a for-each to alter a collection.
I have fixed it by using a normal for instead:

    `public void Publish<TEventBase>(TEventBase eventItem) where TEventBase : EventBase
    {
        if (eventItem == null)
            throw new ArgumentNullException("eventItem");

        List<ISubscription> allSubscriptions = new List<ISubscription>();
        lock (SubscriptionsLock)
        {
            if (_subscriptions.ContainsKey(typeof(TEventBase)))
                allSubscriptions = _subscriptions[typeof(TEventBase)];
        }

        for (int listIndex = allSubscriptions.Count - 1; listIndex >= 0; listIndex--)
        {
            try
            {
                allSubscriptions[listIndex].Publish(eventItem);
            }
            catch (Exception exception)
            {
            }
        }
    }`

Regards :)

Remove unnecessary dependencies

I want to use your library (.NET Standard 2.0) but it adds some dependencies that are not necessary and I don't want them in my project.

https://github.com/mxjones/RedBus/blob/master/src/Redbus/Redbus/Redbus.csproj

You can remove this block and it will compile fine.

  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
    <PackageReference Include="System.Reflection.Emit.LightWeight" Version="4.3.0" />
    <PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
    <PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
  </ItemGroup>
  <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
    <Reference Include="System" />
    <Reference Include="System.Configuration" />
    <Reference Include="System.Core" />
    <Reference Include="Microsoft.CSharp" />
  </ItemGroup>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.