Class: Pindo::TaskSystem::TaskResources::GlobalSharedResourceType

Inherits:
ResourceType
  • Object
show all
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

#name, #strategy

Instance Method Summary collapse

Methods inherited from ResourceType

#directory_based?, #global_exclusive?, #global_shared?, #to_s

Constructor Details

#initialize(name) ⇒ GlobalSharedResourceType

Returns a new instance of GlobalSharedResourceType.

Parameters:

  • name (Symbol)

    资源名称



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

检查两个资源实例是否冲突规则:永不冲突(全局共享)

Parameters:

Returns:

  • (Boolean)

    永远返回 false



28
29
30
# File 'lib/pindo/module/task/task_resources/types/global_shared_resource.rb', line 28

def conflicts?(instance1, instance2)
  false  # 全局共享,永不冲突
end