All Projects → princemaple → together

princemaple / together

Licence: MIT license
Group things together!

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to together

DebounceMonitoring
📑 Add debounce logic for any method in a single line.
Stars: ✭ 44 (+25.71%)
Mutual labels:  throttle, debounce
anim-event
Event Manager for Animation
Stars: ✭ 25 (-28.57%)
Mutual labels:  throttle, debounce
RateLimiting.NET
Rate Limiting (debounce, throttle) for C# Portable Class Library
Stars: ✭ 20 (-42.86%)
Mutual labels:  throttle, debounce
Javainterview
java中高级基础指南
Stars: ✭ 222 (+534.29%)
Mutual labels:  job
Shardingsphere Elasticjob Cloud
Stars: ✭ 248 (+608.57%)
Mutual labels:  job
Forest
分布式任务调度平台,分布式,任务调度,schedule,scheduler
Stars: ✭ 231 (+560%)
Mutual labels:  job
Farseer.Net
Provides consistent standard use of common components of the .Net Core language
Stars: ✭ 42 (+20%)
Mutual labels:  job
Resources
知名互联网企业内推资料整理 持续更新ing 。 目前已经维护五个微信群接近3000人,欢迎你的加入!
Stars: ✭ 1,910 (+5357.14%)
Mutual labels:  job
YACLib
Yet Another Concurrency Library
Stars: ✭ 193 (+451.43%)
Mutual labels:  job
laravel-applicant
Simple package to allow model applies and receives applications from other models
Stars: ✭ 31 (-11.43%)
Mutual labels:  job
render-props
㸚 Easy-to-use React state containers which utilize the render props (function as child) pattern
Stars: ✭ 33 (-5.71%)
Mutual labels:  debounce
SpaceWar-ECS
A space war game made with ECS and JobSystem in Unity.
Stars: ✭ 26 (-25.71%)
Mutual labels:  job
legacy-bottlerockets
Node.js high availability queue and scheduler for background job processing
Stars: ✭ 25 (-28.57%)
Mutual labels:  job
defense
🔮 A Crystal HTTP handler for throttling, blocking and tracking malicious requests.
Stars: ✭ 51 (+45.71%)
Mutual labels:  throttle
patronum
☄️ Effector operators library delivering modularity and convenience ✨
Stars: ✭ 244 (+597.14%)
Mutual labels:  debounce
ets2-job-logger
ETS2 Job Logger
Stars: ✭ 15 (-57.14%)
Mutual labels:  job
Saturn
The vip.com's distributed job scheduling platform.
Stars: ✭ 2,141 (+6017.14%)
Mutual labels:  job
myprofile
Generate your resume easily from Github actions ✅ using discussion section 📃 🚀
Stars: ✭ 19 (-45.71%)
Mutual labels:  job
redebounce
↘️ Render Props component to debounce the given value
Stars: ✭ 14 (-60%)
Mutual labels:  debounce
Akka.Quartz.Actor
Quartz scheduling actor
Stars: ✭ 50 (+42.86%)
Mutual labels:  job

Together

Hex.pm Documentation

Group actions that can be handled / responded to later together

What for?

  • group notifications to be sent in one email
    • cancel the previously queued email if another event happens within a short period (type: debounce)
  • make heavy operations happen less often, i.e. refresh some global statistics
    • allow only 1 operation per certain period (type: throttle)
  • protect some write api
    • additonally you can choose to use the first value in a period (keep: first)
    • or the last value in the period (keep: last)

Installation

The package can be installed as:

Add together to your list of dependencies in mix.exs:

def deps do
  [{:together, "~> 0.5"}]
end

Since ex_shards uses shards, if you are still using applications instead of the new extra_applications, which infers applications list, make sure that shards is added to the list:

def application do
  [applications: [:shards]]
end

How to use

Start Together.Supervisor to use it

  • Start with application configs
supervisor(Together.Supervisor, [])
  • Start with configs passed in
supervisor(Together.Supervisor, [workers: ..., store: ...])

Make calls to the worker process:

Together.process(binary_name, "something_unique", some_func)
Together.process(pid, "some_unique_name_or_id", a_function)
Together.process(Together.Worker, "id", Module, :func, [arg1, arg2, ...])

Example config

config :together,
  workers: [
    # name is required, can be anything, prefer strings
    [name: "throttled_job", delay: 30_000, type: :throttle],
    [name: "debounced_job", delay: 5_000, type: :debounce],
    [name: "keep_first_job", keep: :first],
    # etc
  ],
  # omissible, if you don't want to change anything
  store: [
    # name for the Store process
    name: MyApp.Together.Store,
    # name for the ExShards main process
    shards_name: MyApp.Together.Store.Shards,
    # for distributed ets
    scope: :g,
    # nodes in the cluster, will use `Node.list` if omitted
    nodes: [:"[email protected]", :"[email protected]"]
  ]

More ideas

  • keep: all (seems to be touching gen_stage territory)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].