Skip to content

Commit

Permalink
GH-815: Fixed process ID generation. Replaced type with interface.
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <kittaakos@gmail.com>
  • Loading branch information
kittaakos committed Nov 27, 2017
1 parent 8fe8ecb commit e274c62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/process/src/node/process-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export class ProcessManager {
}

register(process: Process): number {
this.processes.set(++this.id, process);
return this.id;
const id = this.id;
this.processes.set(id, process);
this.id++;
return id;
}

get(id: number): Process | undefined {
Expand Down
4 changes: 3 additions & 1 deletion packages/process/src/node/terminal-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export interface TerminalProcessOptions {
}

export const TerminalProcessFactory = Symbol("TerminalProcessFactory");
export type TerminalProcessFactory = (options: TerminalProcessOptions) => TerminalProcess;
export interface TerminalProcessFactory {
(options: TerminalProcessOptions): TerminalProcess;
}

/* Use this instead of the node-pty stream, since the node-pty stream is already resumed. */
class ReadableTerminalStream extends stream.Readable {
Expand Down

0 comments on commit e274c62

Please sign in to comment.