Class: Pindo::TaskSystem::TaskResources::GlobalSharedResourceType
- Inherits:
-
ResourceType
- Object
- ResourceType
- Pindo::TaskSystem::TaskResources::GlobalSharedResourceType
- Defined in:
- lib/pindo/module/task/task_resources/types/global_shared_resource.rb
Overview
全局共享资源类型
特性:
-
无限制并发
-
任意两个实例都不冲突
适用资源:
-
Network(网络操作,可以并发)
-
AppStore Connect(API 调用,可以并发)
-
File System(文件系统读取,可以并发)
Instance Attribute Summary
Attributes inherited from ResourceType
Instance Method Summary collapse
-
#conflicts?(instance1, instance2) ⇒ Boolean
检查两个资源实例是否冲突 规则:永不冲突(全局共享).
-
#initialize(name) ⇒ GlobalSharedResourceType
constructor
A new instance of GlobalSharedResourceType.
Methods inherited from ResourceType
#directory_based?, #global_exclusive?, #global_shared?, #to_s
Constructor Details
#initialize(name) ⇒ GlobalSharedResourceType
Returns a new instance of GlobalSharedResourceType.
18 19 20 |
# File 'lib/pindo/module/task/task_resources/types/global_shared_resource.rb', line 18 def initialize(name) super(name, :global_shared) end |
Instance Method Details
#conflicts?(instance1, instance2) ⇒ Boolean
检查两个资源实例是否冲突规则:永不冲突(全局共享)
28 29 30 |
# File 'lib/pindo/module/task/task_resources/types/global_shared_resource.rb', line 28 def conflicts?(instance1, instance2) false # 全局共享,永不冲突 end |