Skip to content

Conversation

@harsha509
Copy link
Member

No description provided.

*/
export interface ProcessControlService {
/**
* Send a signal to a process
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if pid does not exist?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same below

kill(pid: number): Promise<void>;

/**
* Disable memory limits for a specific process
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this work? what are the default memory limits?

* @param bundleId The bundle identifier
* @returns The process identifier (PID)
*/
processIdentifierForBundleIdentifier(bundleId: string): Promise<number>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if bundleId does not exist?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider including a verb to the method name

* Disable memory limits for a specific process
* @param pid The process identifier
*/
disableMemoryLimitForPid(pid: number): Promise<void>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if this method is called twice on the same process?

const result = await this.channel!.receivePlist();

if (typeof result !== 'number') {
throw new Error(`Failed to launch process: ${JSON.stringify(result)}`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please document this behavior

* Encodes JavaScript objects into NSKeyedArchiver format
* capable of satisfying NSSecureCoding requirements.
*/
export class NSKeyedArchiverEncoder {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this class covered by unit tests?


const log = logger.getLogger('ProcessControl.test');

describe('ProcessControl Service', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some tests for outputEvents generator, we can add steps/requirements as comments in tests if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants