Skip to content

Commit 13c3ff1

Browse files
2 parents 57a10d1 + 213b604 commit 13c3ff1

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/ObservableComputations.Test/OcDispatcherTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ public void TestSetThreadProperites()
288288
OcConfiguration.SaveInstantiationStackTrace = true;
289289
OcDispatcher dispatcher = new OcDispatcher(2);
290290
Assert.AreEqual(dispatcher.GetQueueCount(0), 0);
291+
Assert.AreEqual(dispatcher.GetQueueCount(), 0);
291292
Assert.IsTrue(dispatcher.InstantiationStackTrace != null);
292293
ApartmentState apartmentState = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? ApartmentState.Unknown : ApartmentState.MTA;
293294
Assert.AreEqual(dispatcher.NewInvocationBehaviour, NewInvocationBehaviour.Accept);

src/ObservableComputations/ObservableComputations.csproj

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
1111
<Authors>Igor Buchelnikov ([email protected])</Authors>
1212
<Company>Igor Buchelnikov ([email protected])</Company>
13-
<Description>Cross-platform .NET library for computations whose arguments and results are objects that implement INotifyPropertyChanged and INotifyCollectionChanged (ObservableCollection) interfaces. The computations include ones similar to LINQ, the computation of arbitrary expression and additional features. The computations are implemented as extension methods, like LINQ ones. You can combine calls of ObservableComputations extension methods including chaining and nesting, as you do for LINQ methods. Computations in background threads, including parallel ones, as well as time-related processing of CollectionChanged and PropertyChanged events, are supported. ObservableComputations is easy to use and powerful implementation of reactive programming paradigm. With ObservableComputations, your code will fit more to the functional style than with standard LINQ.</Description>
13+
<Description>Cross-platform .NET library for computations whose arguments and results are objects that implement INotifyPropertyChanged and INotifyCollectionChanged (ObservableCollection) interfaces. The computations include ones similar to LINQ, the computation of arbitrary expression, and additional features. The computations are implemented as extension methods, like LINQ ones. You can combine calls of ObservableComputations extension methods including chaining and nesting, as you do for LINQ methods. Computations in background threads, including parallel ones, as well as time-related processing of CollectionChanged and PropertyChanged events, are supported. ObservableComputations is easy to use and powerful implementation of reactive programming paradigm. With ObservableComputations, your code will fit more to the functional style than with standard LINQ.</Description>
1414
<PackageLicenseUrl>https://github.com/IgorBuchelnikov/ObservableComputations/blob/master/LICENSE</PackageLicenseUrl>
1515
<PackageProjectUrl>https://github.com/IgorBuchelnikov/ObservableComputations</PackageProjectUrl>
1616
<RepositoryUrl>https://github.com/IgorBuchelnikov/ObservableComputations.git</RepositoryUrl>
@@ -19,28 +19,26 @@
1919
<NeutralLanguage>en</NeutralLanguage>
2020
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2121
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
22-
<PackageReleaseNotes>* New feaures
23-
OcDispatcher async delegates with await
24-
OcDispatcher InvocationResult IReadScalar
25-
OcDispatcher InvocationResult Invocation
26-
OcDispatcher Status Property
27-
22+
<PackageReleaseNotes>* New features
23+
"async" and "await" keywords support in OcDispatcher
24+
OcDispatcher's InvocationResult now implements IReadScalar
2825

2926
* Fixed:
3027
— CollectionPausing
3128
— ScalarPausing
3229
— CollectionDispatching
3330
— OcDispatcher
31+
— other bug fixes
3432

3533
* Renamed
3634
InvocationResult.Result -&gt; InvocationResult.Value
37-
DebugInfo.ExecutingOcDispatcherInvocations -&gt; StaticInfo.ExecutingOcDispatcherInvocationStacks
35+
DebugInfo -&gt; StaticInfo
3836
OcDispatcher.BeginInvoke -&gt; OcDispatcher.InvokeAsync
3937
Configuration -&gt; OcConfiguration
4038

4139
* API changed
4240
— Binding
43-
</PackageReleaseNotes>
41+
— StaticInfo</PackageReleaseNotes>
4442
<Version>2.1.0</Version>
4543
<AssemblyName>ObservableComputations</AssemblyName>
4644
<PackageId>ObservableComputations</PackageId>

src/ObservableComputations/OcDispatcher.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.ComponentModel;
88
using System.Diagnostics;
99
using System.Globalization;
10+
using System.Linq;
1011
using System.Threading;
1112
using System.Threading.Tasks;
1213
using ThreadState = System.Threading.ThreadState;
@@ -188,7 +189,10 @@ public NewInvocationBehaviour NewInvocationBehaviour
188189
}
189190
}
190191

191-
public int GetQueueCount(int priority = 0) => _invocationQueues[priority].Count;
192+
public int GetQueueCount(int? priority = null) =>
193+
priority == null
194+
? _invocationQueues.Sum(q => q.Count)
195+
: _invocationQueues[priority.Value].Count;
192196

193197
internal Invocation queueInvocation(Action action, int priority, object context,
194198
bool setSynchronizationContext, Invocation parent, ManualResetEventSlim doneManualResetEvent = null)

0 commit comments

Comments
 (0)