load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load(
    "@fbsource//xplat/folly:defs.bzl",
    "folly_xplat_library",
)
load("@fbsource//xplat/pfh/triage_InfrastructureSupermoduleOptou:DEFS.bzl", "triage_InfrastructureSupermoduleOptou")

oncall("fbcode_entropy_wardens_folly")

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "priority_lifo_sem_mpmc_queue",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = [
        "PriorityLifoSemMPMCQueue.h",
    ],
    deps = [
        "//third-party/glog:glog",
        "//xplat/folly:executor",
        "//xplat/folly:mpmc_queue",
        "//xplat/folly:range",
        "//xplat/folly:synchronization_lifo_sem",
        "//xplat/folly/executors/task_queue:blocking_queue",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "blocking_queue",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = [
        "BlockingQueue.h",
    ],
    deps = [
        "//third-party/glog:glog",
        "//xplat/folly:c_portability",
        "//xplat/folly:optional",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "lifo_sem_mpmc_queue",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = [
        "LifoSemMPMCQueue.h",
    ],
    exported_deps = [
        "//xplat/folly:mpmc_queue",
        "//xplat/folly:synchronization_lifo_sem",
        "//xplat/folly/executors/task_queue:blocking_queue",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "priority_unbounded_blocking_queue",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = [
        "PriorityUnboundedBlockingQueue.h",
    ],
    deps = [
        "//xplat/folly:constexpr_math",
        "//xplat/folly:executor",
        "//xplat/folly:synchronization_lifo_sem",
        "//xplat/folly/concurrency:priority_unbounded_queue_set",
        "//xplat/folly/executors/task_queue:blocking_queue",
        "//xplat/folly/lang:exception",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "unbounded_blocking_queue",
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = [
        "UnboundedBlockingQueue.h",
    ],
    deps = [
        "//xplat/folly:synchronization_lifo_sem",
        "//xplat/folly/concurrency:unbounded_queue",
        "//xplat/folly/executors/task_queue:blocking_queue",
    ],
)

# !!!! fbcode/folly/executors/task_queue/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!!

fbcode_target(
    _kind = cpp_library,
    name = "blocking_queue",
    headers = ["BlockingQueue.h"],
    exported_deps = [
        "//folly:c_portability",
        "//folly:optional",
    ],
    exported_external_deps = [
        "glog",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "lifo_sem_mpmc_queue",
    headers = ["LifoSemMPMCQueue.h"],
    exported_deps = [
        ":blocking_queue",
        "//folly:mpmc_queue",
        "//folly/synchronization:lifo_sem",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "priority_lifo_sem_mpmc_queue",
    headers = ["PriorityLifoSemMPMCQueue.h"],
    exported_deps = [
        ":blocking_queue",
        "//folly:executor",
        "//folly:mpmc_queue",
        "//folly:range",
        "//folly/synchronization:lifo_sem",
    ],
    exported_external_deps = [
        "glog",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "priority_unbounded_blocking_queue",
    headers = ["PriorityUnboundedBlockingQueue.h"],
    exported_deps = [
        ":blocking_queue",
        "//folly:constexpr_math",
        "//folly:executor",
        "//folly/concurrency:priority_unbounded_queue_set",
        "//folly/lang:exception",
        "//folly/synchronization:lifo_sem",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "unbounded_blocking_queue",
    headers = ["UnboundedBlockingQueue.h"],
    exported_deps = [
        ":blocking_queue",
        "//folly/concurrency:unbounded_queue",
        "//folly/synchronization:lifo_sem",
    ],
)
