Coder Social home page Coder Social logo

Comments (4)

PeteGoo avatar PeteGoo commented on June 4, 2024

Thanks for the feedback.

In regards to static state on generic types see this gist I just created https://gist.github.com/PeteGoo/5043985
also this http://stackoverflow.com/questions/9647641/resharper-warns-static-field-in-generic-type

Totally agree on the cleanup of the subscriptions. I'll have a look at a fix soon.

from pushqa.

IanYates avatar IanYates commented on June 4, 2024

The gist looks like it confirms Jon Skeet's answer on StackOverflow, which disagrees with

[According to ReSharper...] Static objects in generic classes are shared regardless of the type of T.

There's a bit on the gist which threw me for a moment when I adapted it for Linqpad - You had

Console.WriteLine("setting a = b1");
Foo.SharedValue = "a2";

The WriteLine should be "setting a = a2" :)

I'm looking at possibly making use of this project in some upcoming development so I have the follow tag set - sorry to bust in on the issue discussion...

from pushqa.

PeteGoo avatar PeteGoo commented on June 4, 2024

bust away! Welcome. The intention was to take advantage of the inherent per-type combination caching that comes as part of putting a static field on a generic.

Whoops, yes, updated the gist

from pushqa.

scottt732 avatar scottt732 commented on June 4, 2024

Yeah.. You're right. I noticed the warning yesterday when I switched from the package reference to the library reference to debug through some stuff. I was having a hell of a time debugging a bug where I was getting 1-3 of the events on an infinite Qbservable stream and naturally assumed it was your fault :-). I was using a ReplaySubject with an AsQbservable and I needed to make them both static. I was getting new instances of the context and didn't realize it. That and I misinterpreted the Resharper warning backwardslywise.

So if the type collection really is specific to T's, nevermind that part. I'm still trying to wrap my head all the way around Rx, but I think this IDisposable disposal thing might still be relevant.

This project is a game changer... It was pretty trivial to give a simple log4net appender splunk-like super powers.

from pushqa.

Related Issues (8)

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.