Returns queue entries as a plain list of records with fields value and
priority, in queue sequence order.
Usage
# S3 method for class 'priority_queue'
as.list(x, ..., drop_meta = FALSE)Details
Each returned entry is a record with fields value and priority.
Entry names (when present) are preserved on the returned list.
Examples
q <- priority_queue("a", "b", priorities = c(2, 1))
as.list(q)
#> [[1]]
#> [[1]]$value
#> [1] "a"
#>
#> [[1]]$priority
#> [1] 2
#>
#>
#> [[2]]
#> [[2]]$value
#> [1] "b"
#>
#> [[2]]$priority
#> [1] 1
#>
#>
as.list(q, drop_meta = TRUE)
#> [[1]]
#> [1] "a"
#>
#> [[2]]
#> [1] "b"
#>