MCPcopy Create free account
hub / github.com/AutoCodeStack/ios-device-farm / Pipeline

Class Pipeline

public/static/js/renderer/pipeline.js:2–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1// Pipeline to manage the flow of frames
2class Pipeline {
3 constructor() {
4 this.back = new BackFrame();
5 this.mid = new FrontFrame("mid");
6 this.front = new FrontFrame("front");
7 }
8
9 push(blob) {
10 this.back.swap(blob);
11
12 if (!this.mid.loading && !this.mid.loaded) {
13 this.mid.load(this.back.consume());
14 }
15 }
16
17 consume() {
18 if (this.mid.loaded) {
19 const temp = this.mid;
20 this.mid = this.front;
21 this.front = temp;
22 this.mid.load(this.back.consume());
23 } else if (!this.mid.loading) {
24 this.mid.load(this.back.consume());
25 }
26
27 return this.front.consume();
28 }
29
30 destroy() {
31 this.back.destroy();
32 this.mid.destroy();
33 this.front.destroy();
34 }
35}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected