Skip to content

Commit

Permalink
Merge branch 'features/websocket' of https://github.com/samchon/tgrid
Browse files Browse the repository at this point in the history
…into features/website
  • Loading branch information
samchon committed May 7, 2024
2 parents e225fa1 + 1a97b8b commit 300ab35
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tgrid",
"version": "1.0.0-dev.20240506",
"version": "1.0.0-dev.20240507",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/workers/internal/FileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type fs from "fs";
import { NodeModule } from "../../../utils/internal/NodeModule";

/**
* @hidden
* @internal
*/
export namespace FileSystem {
/* ----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/workers/internal/IReject.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @hidden
* @internal
*/
export interface IReject {
name: "reject";
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/workers/internal/IWorkerCompiler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @hidden
* @internal
*/
export interface IWorkerCompiler {
compile(content: string): Promise<string>;
Expand All @@ -8,7 +8,7 @@ export interface IWorkerCompiler {
}

/**
* @hidden
* @internal
*/
export namespace IWorkerCompiler {
export type Creator = {
Expand Down
5 changes: 4 additions & 1 deletion src/protocols/workers/internal/NodeWorkerCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ProcessWorker } from "./processes/ProcessWorker";
import { ThreadWorker } from "./threads/ThreadWorker";

/**
* @hidden
* @internal
*/
export const NodeWorkerCompiler = async (
type: "process" | "thread",
Expand Down Expand Up @@ -41,6 +41,9 @@ export const NodeWorkerCompiler = async (
// }
});

/**
* @internal
*/
const uuid = () =>
"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
const r = (Math.random() * 16) | 0;
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/workers/internal/WebWorkerCompiler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IWorkerCompiler } from "./IWorkerCompiler";

/**
* @hidden
* @internal
*/
export const WebWorkerCompiler = async (): Promise<IWorkerCompiler> => ({
compile: async (content) => {
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/workers/internal/processes/ProcessChannel.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NodeModule } from "../../../../utils/internal/NodeModule";

/**
* @hidden
* @internal
*/
export class ProcessChannel {
public static postMessage(message: any): void {
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/workers/internal/processes/ProcessWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NodeModule } from "../../../../utils/internal/NodeModule";
import { IWorkerCompiler } from "../IWorkerCompiler";

/**
* @hidden
* @internal
*/
export async function ProcessWorker(): Promise<IWorkerCompiler.Creator> {
const { fork } = await NodeModule.cp.get();
Expand Down
10 changes: 5 additions & 5 deletions src/protocols/workers/internal/threads/ThreadPort.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
//================================================================

/** @module tgrid.protocols.workers */
//================================================================
import { NodeModule } from "../../../../utils/internal/NodeModule";

/**
* @hidden
* @internal
*/

export async function ThreadPort() {
Expand Down Expand Up @@ -34,6 +30,10 @@ export async function ThreadPort() {
}
return ThreadPort;
}

/**
* @internal
*/
export namespace ThreadPort {
export async function isWorkerThread(): Promise<boolean> {
const { parentPort } = await NodeModule.thread.get();
Expand Down
6 changes: 1 addition & 5 deletions src/protocols/workers/internal/threads/ThreadWorker.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
//================================================================

/** @module tgrid.protocols.workers */
//================================================================
import type thread from "worker_threads";

import { NodeModule } from "../../../../utils/internal/NodeModule";
import { IWorkerCompiler } from "../IWorkerCompiler";

/**
* @hidden
* @internal
*/
export async function ThreadWorker(): Promise<IWorkerCompiler.Creator> {
const { Worker } = await NodeModule.thread.get();
Expand Down

0 comments on commit 300ab35

Please sign in to comment.