Class: UringMachine::Queue
- Inherits:
-
Object
- Object
- UringMachine::Queue
- Defined in:
- ext/um/um_queue_class.c,
ext/um/um_queue_class.c
Overview
A futex-based Queue implementation. The queue can be manipulated by calling ‘UringMachine#push`, `UringMachine#unshift`, `UringMachine#pop` and `UringMachine#shift`.
Instance Method Summary collapse
-
#count ⇒ Integer
Returns the number of items in the queue.
-
#initialize ⇒ void
constructor
Initializes a new queue instance.
Constructor Details
#initialize ⇒ void
Initializes a new queue instance.
55 56 57 58 59 60 |
# File 'ext/um/um_queue_class.c', line 55 VALUE Queue_initialize(VALUE self) { struct um_queue *queue = Queue_data(self); RB_OBJ_WRITE(self, &queue->self, self); um_queue_init(queue); return self; } |
Instance Method Details
#count ⇒ Integer
Returns the number of items in the queue.
66 67 68 69 |
# File 'ext/um/um_queue_class.c', line 66 VALUE Queue_count(VALUE self) { struct um_queue *queue = Queue_data(self); return UINT2NUM(queue->count); } |