masstransit / greenpipes Goto Github PK
View Code? Open in Web Editor NEWThis project forked from phatboyg/greenpipes
An asynchronous pipe implementation for the Task Parallel Library
License: Apache License 2.0
This project forked from phatboyg/greenpipes
An asynchronous pipe implementation for the Task Parallel Library
License: Apache License 2.0
Similar to the CancellationToken, I often need to pass around an object-typed state so that I can satisfy any of the TAP, EAP, APM programming models that clients might desire.
Right now, I'm deriving from PipeContext and adding a state property because "object" is too indiscriminate for the type-keyed Payload functionality in PipeContext/BasePipeContext.
Have you considered a name-keyed Payload functionality? I haven't looked deeply enough to work out what else Payload is being used for, so that might not be practical.
Hey,
attempt to initialize proxy object of the class, that has a property of same type as class itself causes a StackOverflowException to be thrown.
For example initialization of proxy class for ExceptionInfo interface (from MassTransit) throws:
var exception = TypeCache<ExceptionInfo>.InitializeFromObject(new {});
The specification of a patch level for .NET Framework 4.5 (ie. 4.5**.2**) makes it impossible for us to target a most-common major.minor in our own solutions because GreenPipes "requires" .NET 4.5.2 ... (ie. where we target .NET 4.5 in our packaging, we only assign patch-level to EXE projects, since this is what ultimately determines which CLR patch-level is loaded at runtime, not the patch level specified in any nuspec.)
To clarify:
When you Target and/or Package for .NET Framework 4.5 we can target all patch levels and still use your nuget package, such as .NET 4.5, 4.5.1, 4.5.2, 4.6, 4.7, etc.
When you Target and/or Package for .NET Framwork 4.5.2 (note the patch-level specification) we can only include your package when we also target .NET 4.5.2 or later in our nuspec. Thus, the current version constraint precludes our creating a package which targets the broader .NET Framework 4.5 version.) This has the adverse effect of preventing us from using a platform target of .NET 4.5 in our shared library builds which reference these packages.
Again, we assign/assert/require a Framework patch-level by virtue of the Framework Target of our EXE projects. Class-libraries and their nuspecs necessarily always target the broader Framework Targets (ie. no patch-level.
Can you please make it a matter of practice to target the lowest-supported major+minor (and avoid the specification of a Framework patch-level unless it is absolutely necessary to address a bug)?
We do not have a workaround for this, this framework patch-level constraint breaks our builds and we're unable to leverage the latest MassTransit packages without also taking on this dependency.
Thanks for any assist.. let me know if I can clarify further.
The following (new) test case fails.
[TestFixture]
public class AbstractProperty_Specs
{
[Test]
public void Should_cache_properties_nicely()
{
var cache = new ReadWritePropertyCache<AbstractProperty>(true);
var instance = new AbstractProperty();
const string expectedValue = "Chris";
cache["Name"].Set(instance, expectedValue);
Assert.AreEqual(expectedValue, instance.Name);
}
class AbstractProperty : AbstractClass
{
public override string Name { get; set; }
}
abstract class AbstractClass
{
public abstract string Name { get; set; }
}
}
When creating the cache there seems to be no deduplication of the property names?
static IDictionary<string, ReadWriteProperty<T>> CreatePropertyCache(bool includeNonPublic)
{
return new Dictionary<string, ReadWriteProperty<T>>(typeof(T).GetAllProperties()
.Where(x => x.CanRead && (includeNonPublic || x.CanWrite))
.Where(x => x.SetMethod != null)
.Select(x => new ReadWriteProperty<T>(x))
.ToDictionary(x => x.Property.Name));
}
Inside the nuget package for version 1.0.10, the version for greenpipes.dll is 1.1.0.83
The file and product version are both listed like this.
Shouldn't it be 1.0.10?
I'd love to come with code but it is a bit hard since it is about race conditions.
Here's what is happening in our Production:
SendEndpointCacheDefaults.MaxAge
to be 30 minutes, which is significantly shorter that the default (24 hours). There are reasons for that as we have on-demand service process which is going down when inactive, and we want to dispose inactive channels sooner rather than later.GreenPipes.GreenCache
to cache send endpoints. The above cache as per my understanding of the code has the eviction policy based solely on time, and the time of the bucket is immutable and is only assigned when the bucket is created.This leads once in a while to the following unpleasant scenario:
System.Threading.Tasks.TaskCanceledException A task was canceled ... at MassTransit.RabbitMqTransport.Pipeline.ConfigureTopologyFilter
1.d__6.MoveNext()`When I think of the best resolution to that, in my opinion the timestamp of the GreenCache's bucket should be updated when the bucket is used, i.e. switch from "created" to "last used" time. This would prevent the used objects from being evicted.
Yeah, you don't use ??=
in a highly threaded system. Live and learn.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.