PORTS: Add ns.nextPortWrite() as a safer option (#1036)

This commit is contained in:
LJ
2024-01-15 04:10:39 -07:00
committed by GitHub
parent d0e66d5be2
commit 157ff8ea88
4 changed files with 20 additions and 5 deletions

View File

@@ -6644,6 +6644,17 @@ export interface NS {
*/
tryWritePort(portNumber: number, data: string | number): boolean;
/**
* Listen for a port write.
* @remarks
* RAM cost: 0 GB
*
* Sleeps until the port is written to.
*
* @param port - Port to listen for a write on. Must be a positive integer.
*/
nextPortWrite(port: number): Promise<void>;
/**
* Read content of a file.
* @remarks