@@ -21,7 +21,7 @@ import {
2121 OpResponse ,
2222 StopSequenceMessageData ,
2323 HostProxy ,
24- ICommunicationHandler ,
24+ ICommunicationHandler
2525} from "@scramjet/types" ;
2626import {
2727 AppError ,
@@ -165,12 +165,12 @@ export class CSIController extends TypedEmitter<Events> {
165165 public communicationHandler : ICommunicationHandler ,
166166 private sthConfig : STHConfiguration ,
167167 private hostProxy : HostProxy ,
168- private adapter : STHConfiguration [ "runtimeAdapter" ] = sthConfig . runtimeAdapter ,
168+ private adapter : STHConfiguration [ "runtimeAdapter" ] = sthConfig . runtimeAdapter
169169 ) {
170170 super ( ) ;
171171
172172 this . id = this . handshakeMessage . id ;
173- this . sequence = this . handshakeMessage . sequence ;
173+ this . sequence = this . handshakeMessage . sequenceInfo ;
174174 this . appConfig = this . handshakeMessage . payload . appConfig ;
175175 this . args = this . handshakeMessage . payload . args ;
176176 this . outputTopic = this . handshakeMessage . payload . outputTopic ;
@@ -186,12 +186,14 @@ export class CSIController extends TypedEmitter<Events> {
186186 this . logger . debug ( "Constructor executed" ) ;
187187
188188 this . status = InstanceStatus . INITIALIZING ;
189+
190+
189191 }
190192
191193 async start ( ) {
192194 const i = new Promise ( ( res , rej ) => {
193195 this . initResolver = { res, rej } ;
194- // this.startInstance();
196+ this . startInstance ( ) ;
195197 } ) ;
196198
197199 i . then ( ( ) => this . main ( ) ) . catch ( async ( e ) => {
@@ -256,6 +258,8 @@ export class CSIController extends TypedEmitter<Events> {
256258
257259 this . _instanceAdapter . logger . pipe ( this . logger , { end : false } ) ;
258260
261+ this . endOfSequence = this . _instanceAdapter . waitUntilExit ( undefined , this . id , this . sequence )
262+
259263 // @todo this also is moved to CSIDispatcher in entirety
260264 const instanceMain = async ( ) => {
261265 try {
@@ -507,7 +511,7 @@ export class CSIController extends TypedEmitter<Events> {
507511 }
508512
509513 this . info . ports = message [ 1 ] . ports ;
510- this . sequence = message [ 1 ] . sequence ;
514+ this . sequence = message [ 1 ] . sequenceInfo ;
511515
512516 // TODO: add message to initiate the instance adapter
513517
@@ -525,7 +529,7 @@ export class CSIController extends TypedEmitter<Events> {
525529 }
526530
527531 this . info . started = new Date ( ) ;
528- this . logger . info ( "Instance started" , this . info ) ;
532+ this . logger . info ( "Instance started" , JSON . stringify ( message , undefined , 4 ) ) ;
529533 }
530534
531535 async handleInstanceConnect ( streams : DownstreamStreamsConfig ) {
0 commit comments