(a: A)
| 2707 | this.index++ |
| 2708 | } |
| 2709 | offer(a: A): number { |
| 2710 | const index = this.publisherIndex++ |
| 2711 | this.tail.value = a |
| 2712 | this.tail.index = index |
| 2713 | this.tail.next = { |
| 2714 | value: AbsentValue, |
| 2715 | index: 0, |
| 2716 | next: null |
| 2717 | } |
| 2718 | this.tail = this.tail.next |
| 2719 | if (this.size === this.capacity) { |
| 2720 | this.head = this.head.next! |
| 2721 | } else { |
| 2722 | this.size += 1 |
| 2723 | } |
| 2724 | return index |
| 2725 | } |
| 2726 | offerAll(as: Iterable<A>): void { |
| 2727 | for (const a of as) { |
| 2728 | this.offer(a) |
no outgoing calls