git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 9ab9ec4202546f2fe720b39f0b9950ee7621d0b6

rename in abstract container

wanderer committed on 11/21/2017, 9:27:05 PM
Parent: f6890c630f97bee18c05dac66e886069049ec4ab

Files changed

package-lock.jsonchanged
package.jsonchanged
tests/index.jschanged
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 321574 bytes
New file size: 321574 bytes
package.jsonView
@@ -43,9 +43,9 @@
4343 "coveralls": "^3.0.0",
4444 "documentation": "^5.3.3",
4545 "level": "^2.0.1",
4646 "nyc": "^11.3.0",
47- "primea-abstract-container": "0.0.5",
47+ "primea-abstract-container": "0.0.6",
4848 "standard": "10.0.3",
4949 "tape": "^4.6.3"
5050 }
5151 }
tests/index.jsView
@@ -69,9 +69,9 @@
6969
7070 class testVMContainerA extends BaseContainer {
7171 onCreation (m) {
7272 message = new Message()
73- return this.kernel.send(m.caps[0], message)
73+ return this.actor.send(m.caps[0], message)
7474 }
7575 }
7676
7777 class testVMContainerB extends BaseContainer {
@@ -111,9 +111,9 @@
111111
112112 class testVMContainerA extends BaseContainer {
113113 onCreation (m) {
114114 message = new Message()
115- return this.kernel.send(m.caps[0], message)
115+ return this.actor.send(m.caps[0], message)
116116 }
117117 }
118118
119119 class testVMContainerB extends BaseContainer {
@@ -158,12 +158,12 @@
158158 let ticks = 1
159159
160160 class testVMContainerA extends BaseContainer {
161161 async onCreation (m) {
162- this.kernel.incrementTicks(ticks)
162+ this.actor.incrementTicks(ticks)
163163 ticks++
164164 message = new Message()
165- await this.kernel.send(m.caps[0], message)
165+ await this.actor.send(m.caps[0], message)
166166 }
167167 }
168168
169169 class testVMContainerB extends BaseContainer {
@@ -210,10 +210,10 @@
210210
211211 class testVMContainerA extends BaseContainer {
212212 onCreation (m) {
213213 message = new Message()
214- message.responseCap = this.kernel.mintCap()
215- return this.kernel.send(m.caps[0], message)
214+ message.responseCap = this.actor.mintCap()
215+ return this.actor.send(m.caps[0], message)
216216 }
217217
218218 onMessage (m) {
219219 t.true(m, 'should recive a response message')
@@ -257,10 +257,10 @@
257257
258258 class testVMContainerA extends BaseContainer {
259259 onCreation (m) {
260260 message = new Message()
261- message.responseCap = this.kernel.mintCap()
262- return this.kernel.send(m.caps[0], message)
261+ message.responseCap = this.actor.mintCap()
262+ return this.actor.send(m.caps[0], message)
263263 }
264264
265265 onMessage (m) {
266266 t.true(m.data.exceptionError instanceof Error, 'should recive a response message')
@@ -305,11 +305,11 @@
305305
306306 class testVMContainerA extends BaseContainer {
307307 onCreation (m) {
308308 message = new Message()
309- const cap = this.kernel.mintCap()
309+ const cap = this.actor.mintCap()
310310 message.caps.push(cap)
311- return this.kernel.createActor(testVMContainerB.typeId, message)
311+ return this.actor.createActor(testVMContainerB.typeId, message)
312312 }
313313
314314 onMessage (m) {
315315 t.true(m, 'should recive a response message')
@@ -318,9 +318,9 @@
318318
319319 class testVMContainerB extends BaseContainer {
320320 onCreation (m) {
321321 const cap = m.caps[0]
322- return this.kernel.send(cap, new Message())
322+ return this.actor.send(cap, new Message())
323323 }
324324
325325 static get typeId () {
326326 return 8
@@ -358,13 +358,13 @@
358358 })
359359 const message3 = new Message({
360360 data: 'third'
361361 })
362- this.kernel.send(m.caps[0], message1)
363- this.kernel.incrementTicks(1)
364- this.kernel.send(m.caps[0], message2)
365- this.kernel.incrementTicks(1)
366- return this.kernel.send(m.caps[0], message3)
362+ this.actor.send(m.caps[0], message1)
363+ this.actor.incrementTicks(1)
364+ this.actor.send(m.caps[0], message2)
365+ this.actor.incrementTicks(1)
366+ return this.actor.send(m.caps[0], message3)
367367 }
368368 }
369369
370370 let recMsg = 0
@@ -415,9 +415,9 @@
415415 onCreation (m) {
416416 message = new Message({
417417 data: m.data
418418 })
419- this.kernel.send(m.caps[0], message)
419+ this.actor.send(m.caps[0], message)
420420 }
421421 }
422422
423423 let recMsg = 0
@@ -478,13 +478,13 @@
478478
479479 class testVMContainerA extends BaseContainer {
480480 async onMessage (m) {
481481 t.true(m, 'should recive first message')
482- const rCap = this.kernel.mintCap(1)
482+ const rCap = this.actor.mintCap(1)
483483 const message = new Message()
484484 message.responseCap = rCap
485- await this.kernel.send(m.caps[0], message)
486- const rMessage = await this.kernel.inbox.waitOnTag([1], 44)
485+ await this.actor.send(m.caps[0], message)
486+ const rMessage = await this.actor.inbox.waitOnTag([1], 44)
487487 t.true(rMessage, 'should recive a response message')
488488 }
489489 }
490490
@@ -524,15 +524,15 @@
524524
525525 class testVMContainerA extends BaseContainer {
526526 async onMessage (m) {
527527 t.true(m, 'should recive first message')
528- const rCap = this.kernel.mintCap(1)
528+ const rCap = this.actor.mintCap(1)
529529 const message = new Message({data: 'first'})
530530 message.responseCap = rCap
531- await this.kernel.send(m.caps[0], message)
532- const promise = this.kernel.inbox.waitOnTag([1], 44)
531+ await this.actor.send(m.caps[0], message)
532+ const promise = this.actor.inbox.waitOnTag([1], 44)
533533 try {
534- await this.kernel.inbox.waitOnTag([1], 44)
534+ await this.actor.inbox.waitOnTag([1], 44)
535535 } catch (e) {
536536 t.true(e, 'should error if waiting twice')
537537 }
538538 return promise
@@ -576,10 +576,10 @@
576576 class testVMContainerA extends BaseContainer {
577577 async onMessage (m) {
578578 t.true(m, 'should recive first message')
579579 if (m.caps.length) {
580- const cap1 = this.kernel.mintCap(1)
581- const cap2 = this.kernel.mintCap(2)
580+ const cap1 = this.actor.mintCap(1)
581+ const cap2 = this.actor.mintCap(2)
582582 const message1 = new Message({
583583 data: 'first'
584584 })
585585 const message2 = new Message({
@@ -587,12 +587,12 @@
587587 })
588588 message1.caps.push(cap1)
589589 message2.caps.push(cap2)
590590 await Promise.all([
591- this.kernel.send(m.caps[0], message1),
592- this.kernel.send(m.caps[1], message2)
591+ this.actor.send(m.caps[0], message1),
592+ this.actor.send(m.caps[1], message2)
593593 ])
594- const rMessage = await this.kernel.inbox.waitOnTag([1, 2], 44)
594+ const rMessage = await this.actor.inbox.waitOnTag([1, 2], 44)
595595 t.true(rMessage, 'should recive a response message')
596596 }
597597 }
598598 }
@@ -600,10 +600,10 @@
600600 class testVMContainerB extends BaseContainer {
601601 async onMessage (m) {
602602 t.true(m, 'should recive a message')
603603 const cap = m.caps[0]
604- this.kernel.incrementTicks(1)
605- await this.kernel.send(cap, new Message({data: m.data}))
604+ this.actor.incrementTicks(1)
605+ await this.actor.send(cap, new Message({data: m.data}))
606606
607607 return new Promise((resolve, reject) => {
608608 setTimeout(resolve, 200)
609609 })
@@ -642,21 +642,21 @@
642642 class testVMContainerA extends BaseContainer {
643643 async onMessage (m) {
644644 t.true(m, 'should recive first message')
645645 if (m.caps.length) {
646- const cap1 = this.kernel.mintCap(1)
647- const cap2 = this.kernel.mintCap(2)
646+ const cap1 = this.actor.mintCap(1)
647+ const cap2 = this.actor.mintCap(2)
648648 const message1 = new Message({
649649 data: 'first'
650650 })
651651 const message2 = new Message({
652652 data: 'second'
653653 })
654654 message1.caps.push(cap1)
655655 message2.caps.push(cap2)
656- await this.kernel.send(m.caps[0], message1)
657- await this.kernel.send(m.caps[1], message2)
658- const rMessage = await this.kernel.inbox.waitOnTag([1, 2], 44)
656+ await this.actor.send(m.caps[0], message1)
657+ await this.actor.send(m.caps[1], message2)
658+ const rMessage = await this.actor.inbox.waitOnTag([1, 2], 44)
659659 t.true(rMessage, 'should recive a response message')
660660 }
661661 }
662662 }
@@ -664,10 +664,10 @@
664664 class testVMContainerB extends BaseContainer {
665665 async onMessage (m) {
666666 t.true(m, 'should recive a message')
667667 const cap = m.caps[0]
668- this.kernel.incrementTicks(1)
669- await this.kernel.send(cap, new Message({data: m.data}))
668+ this.actor.incrementTicks(1)
669+ await this.actor.send(cap, new Message({data: m.data}))
670670
671671 return new Promise((resolve, reject) => {
672672 setTimeout(resolve, 200)
673673 })
@@ -706,21 +706,21 @@
706706 class testVMContainerA extends BaseContainer {
707707 async onMessage (m) {
708708 t.true(m, 'should recive first message')
709709 if (m.caps.length) {
710- const cap1 = this.kernel.mintCap(1)
711- const cap2 = this.kernel.mintCap(2)
710+ const cap1 = this.actor.mintCap(1)
711+ const cap2 = this.actor.mintCap(2)
712712 const message1 = new Message({
713713 data: 'first'
714714 })
715715 const message2 = new Message({
716716 data: 'second'
717717 })
718718 message1.caps.push(cap1)
719719 message2.caps.push(cap2)
720- await this.kernel.send(m.caps[0], message1)
721- await this.kernel.send(m.caps[1], message2)
722- const rMessage = await this.kernel.inbox.waitOnTag([2], 44)
720+ await this.actor.send(m.caps[0], message1)
721+ await this.actor.send(m.caps[1], message2)
722+ const rMessage = await this.actor.inbox.waitOnTag([2], 44)
723723 t.true(rMessage, 'should recive a response message')
724724 }
725725 }
726726 }
@@ -728,10 +728,10 @@
728728 class testVMContainerB extends BaseContainer {
729729 async onMessage (m) {
730730 t.true(m, 'should recive a message')
731731 const cap = m.caps[0]
732- this.kernel.incrementTicks(1)
733- await this.kernel.send(cap, new Message({data: m.data}))
732+ this.actor.incrementTicks(1)
733+ await this.actor.send(cap, new Message({data: m.data}))
734734
735735 return new Promise((resolve, reject) => {
736736 setTimeout(resolve, 200)
737737 })
@@ -769,18 +769,18 @@
769769
770770 class testVMContainerA extends BaseContainer {
771771 async onMessage (m) {
772772 t.true(m, 'should recive first message 1')
773- const rMessage = await this.kernel.inbox.waitOnTag([1], 50)
773+ const rMessage = await this.actor.inbox.waitOnTag([1], 50)
774774 t.equals(rMessage, undefined, 'should recive a response message 1')
775775 }
776776 }
777777
778778 class testVMContainerB extends BaseContainer {
779779 async onMessage (m) {
780780 t.true(m, 'should recive first message 2')
781- this.kernel.incrementTicks(47)
782- const rMessage = await this.kernel.inbox.waitOnTag([1], 1)
781+ this.actor.incrementTicks(47)
782+ const rMessage = await this.actor.inbox.waitOnTag([1], 1)
783783 t.equals(rMessage, undefined, 'should recive a response message 2')
784784 }
785785
786786 static get typeId () {
@@ -790,10 +790,10 @@
790790
791791 class testVMContainerC extends BaseContainer {
792792 async onMessage (m) {
793793 t.true(m, 'should recive first message 3')
794- this.kernel.incrementTicks(45)
795- const rMessage = await this.kernel.inbox.waitOnTag([1], 1)
794+ this.actor.incrementTicks(45)
795+ const rMessage = await this.actor.inbox.waitOnTag([1], 1)
796796 t.equals(rMessage, undefined, 'should recive a response message 3')
797797 }
798798
799799 static get typeId () {

Built with git-ssb-web