feature/sort_mode_handman123#1677
Open
handman123 wants to merge 5 commits into
Open
Conversation
Owner
|
很好的需求! |
Owner
|
不过我第一个想法是把模拟器当作调度任务的需求资源, |
Owner
|
那如果多个账号,同时同一个时间点,都有一个很重要的任务需要执行,这种好像就满足不了。不过好像问题不大 |
Author
我想了想,这样确实更好,可以做一个“模拟器池”的这么一个模型,类似线程池,需要执行任务从池子中获取空闲模拟器。然后再配合账号切换的功能,就完全可以实现模拟器资源化,不用把配置和模拟器绑定。但是目前的这个已经满足我的需求了,我不咋想再折腾了😂 |
Author
这个好说,普通用户(不是脚本代肝的商人),最多就只有两个主号,再加一个优先级的功能,让主号优先执行,至于小号,只要在活动截止之前完成就行了。我是只有一个主号,所以主号不开“排队模式”,只有三个小号才需要竞争执行权,所以对我来说问题不大。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
增加排队模式
(该功能只在mac上测试过,win电脑坏了一直没修,不知道在win上有没有其它问题)
如果需要脚本同时管理多个账号(多开),但服务器或者个人电脑性能不够(无法稳定流畅的同时运行多个模拟器),就会出现严重卡顿。不如将原本的并行执行改为串行执行。
多个实例按照先来先服务的调度策略依次执行。
流程:
说明:不参与排队的实例,按照原逻辑执行。
应用场景:
想要多开且电脑性能不够
未来扩展:
queue_mode选项的实例集合,只能同一时刻执行一个模拟器,但如果电脑性能更好一些,同一时刻完全可以带多个模拟器。因此,后续可将互斥锁升级为信号量,允许配置最大并行数 N,同一时刻最多 N 个实例同时执行。Summary by Sourcery
引入跨进程的排队机制,使多个脚本实例能够顺序使用模拟器,从而避免并发加载问题。
新特性:
queue_mode优化选项和空闲阈值配置,用于控制多实例间的串行执行。InstanceGuard组件,通过共享状态文件和心跳监控来协调执行令牌。queue_mode时强制执行“先到先执行”的顺序。错误修复:
EmulatorNotRunningError时,通过重启模拟器并重新连接 ADB 来恢复。增强项:
Original summary in English
Summary by Sourcery
Introduce a cross-process queueing mechanism so that multiple script instances can serialize emulator usage and avoid concurrent load issues.
New Features:
Bug Fixes:
Enhancements: