GithubHelp home page GithubHelp logo

reactiveui / punchclock Goto Github PK

View Code? Open in Web Editor NEW
261.0 261.0 21.0 4.6 MB

Make sure your asynchronous operations show up to work on time

License: MIT License

C# 100.00%
async cross-platform dotnet dotnet-core http-client xamarin

punchclock's Issues

Resume Queue Implemented

Has ResumeQueue been implemented yet?

readme says it supports Pause/Resume:

  • I am able to see and call the .PauseQueue();
  • but don't see how to "un pause"
  • I tried calling .PauseQueue(); twice just to see what would happen and that doesn't "toggle" it :)

(Thank you for all the awesome libraries btw)

Allow maximumConcurrent value to be changed on an OperationQueue instance

Hi Paul,

I have a scenario where I want to change the maximumConcurrent value.

For example, when I know I'm going to have an intense sync happening I want to increase the amount of concurrent http requests. And, after I'm done, I want to lower it back.

Right now, as a consumer of punchclock, the only place where I can change that value is in the constructor of the queue instance.

Single Operation

First off, Simple, yet very elegant library!

The string keys preventing concurrent operations of the same key, is a very nice feature. I'd very much like to see a feature where there can be a restriction to also ignore operations with the same key if one already exists in the queue, equal to, or higher than the given priority.

This could be immensely useful in repeated operations, where you don't keep adding similar ops to the queue if one already exists.

Thoughts?

feature: extend the OperationQueue by adding support for randomness

Is your feature request related to a problem? Please describe.
I want to add jittering (noise) to my http-request-queues for a specific endpoint.
Discovered Fusillade and it would be awesome to have this on OperationQueue.

Describe the solution you'd like
Trying to improve the performance of a system by adding randomness, as well as
trying to avoid limiting of some endpoint that requires noise.

Describe alternatives you've considered
Set maximumConcurrent to 1 and use:

Observable
    .Return(Unit.Default)
    .Delay(TimeSpan.FromMilliseconds(new Random().Next(min, max)))

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • chore(deps): update dependency roslynator.analyzers to v4.12.2

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/ci-build.yml
.github/workflows/ci-buildAndRelease.yml
.github/workflows/lock.yml
  • dessant/lock-threads v5
nuget
src/Directory.build.props
  • Roslynator.Analyzers 4.12.1
  • stylecop.analyzers 1.2.0-beta.556
  • Nerdbank.GitVersioning 3.6.133
  • Microsoft.SourceLink.GitHub 8.0.0
src/Punchclock.Tests/Punchclock.Tests.csproj
  • coverlet.msbuild 6.0.2
  • PublicApiGenerator 11.1.0
  • DiffEngine 15.3.0
  • FluentAssertions 6.12.0
  • Xunit.StaFact 1.1.11
  • Xunit.SkippableFact 1.4.13
  • xunit.runner.visualstudio 2.8.0
  • xunit.runner.console 2.8.0
  • xunit 2.8.0
  • Microsoft.NET.Test.Sdk 17.9.0
  • Verify.Xunit 24.1.0
  • PublicApiGenerator 11.1.0
src/Punchclock/Punchclock.csproj
src/global.json
  • dotnet-sdk 8.0.10

  • Check this box to trigger a request for Renovate to run again on this repository

Limitation to System.Reactive < 4.0.0 holds me from upgrading other packages (Akavache)

Note: for support questions, please ask on StackOverflow: https://stackoverflow.com/questions/tagged/punchclock . This repository's issues are reserved for feature requests and bug reports.

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Limitation to System.Reactive < 4.0.0

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Ugrade a project with System.Reactive, Fusillade, Punchclock & Akavache.
I need to upgrade Akavache, but this needs System.Reactive >= 4.0.0

What is the expected behavior?
Being able to upgrade my packages to the latest version.

What is the motivation / use case for changing the behavior?
I can't apply fixes in new versions of other packages, because PunchClock (& Fusillade) blocks this.

Which versions of PunchClock, and which platform / OS are affected by this issue? Did this work in previous versions of PunchClock?
v2.1.0. is affected. v2.0.0 does not mention the limitation, but I'm not sure wether it's safe to downgrade to this version in combination with System.Reactive > 4.0.0

Other information (e.g. stacktraces, related issues, suggestions how to fix)
No suggestions, because I don't know why the limitation is needed.

Performance niggle

In PriorityQueue.DequeueAll, it calls down to Dequeue in a loop which means that RemoveAt(0) gets called repeatedly. This means that RemoveAt logic that reallocates the _items array fires repeatedly every time the current _size drops below the 1/4 of then current capacity. If we're doing this against a really large queue, it could end up copying the _items array elements repeatedly (and newing the items array a few times). It might be awesome to pass a emptying flag down to a private overload ofDequeue, which could forward that flag to RemoveAt (either an private overload or just defaulted false value on the current one). When the emptying flag is true , then we skip the _items array reallocation and copy until the _size falls to below the default capacity (currently 16).

https://github.com/paulcbetts/punchclock/blob/master/Punchclock%2FPriorityQueue.cs

I would be happy to submit a PR, but don't want to waste your time if this does seem to be an issue for you.

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.