mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
fix: make handlePayload partial in workers
This commit is contained in:
parent
13c79bdc19
commit
10d66a221e
@ -24,6 +24,9 @@
|
|||||||
"correctness": {
|
"correctness": {
|
||||||
"noUnusedVariables": "off"
|
"noUnusedVariables": "off"
|
||||||
},
|
},
|
||||||
|
"nursery": {
|
||||||
|
"useImportRestrictions": "off"
|
||||||
|
},
|
||||||
"complexity": {
|
"complexity": {
|
||||||
"noUselessLoneBlockStatements": "warn",
|
"noUselessLoneBlockStatements": "warn",
|
||||||
"noBannedTypes": "off",
|
"noBannedTypes": "off",
|
||||||
|
@ -24,9 +24,7 @@ const ShardManagerDefaults: Partial<ShardManagerOptions> = {
|
|||||||
const WorkerManagerDefaults: Partial<WorkerManagerOptions> = {
|
const WorkerManagerDefaults: Partial<WorkerManagerOptions> = {
|
||||||
...ShardManagerDefaults,
|
...ShardManagerDefaults,
|
||||||
shardsPerWorker: 32,
|
shardsPerWorker: 32,
|
||||||
handlePayload: (shardId: number, workerId: number, packet: GatewayDispatchPayload): void => {
|
handlePayload: (_shardId: number, _workerId: number, _packet: GatewayDispatchPayload): void => {},
|
||||||
console.info(`Packet ${packet.t} on shard ${shardId} worker ${workerId}`);
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IdentifyProperties {
|
export interface IdentifyProperties {
|
||||||
|
@ -5,10 +5,10 @@ import { MemoryAdapter, type Adapter } from '../../cache';
|
|||||||
import { BaseClient, type InternalRuntimeConfig } from '../../client/base';
|
import { BaseClient, type InternalRuntimeConfig } from '../../client/base';
|
||||||
import {
|
import {
|
||||||
Logger,
|
Logger,
|
||||||
type MakePartial,
|
|
||||||
MergeOptions,
|
MergeOptions,
|
||||||
type GatewayPresenceUpdateData,
|
type GatewayPresenceUpdateData,
|
||||||
type GatewaySendPayload,
|
type GatewaySendPayload,
|
||||||
|
type MakePartial,
|
||||||
} from '../../common';
|
} from '../../common';
|
||||||
import { WorkerManagerDefaults } from '../constants';
|
import { WorkerManagerDefaults } from '../constants';
|
||||||
import { SequentialBucket } from '../structures';
|
import { SequentialBucket } from '../structures';
|
||||||
@ -26,7 +26,7 @@ export class WorkerManager extends Map<number, Worker & { ready?: boolean }> {
|
|||||||
memberUpdateHandler = new MemberUpdateHandler();
|
memberUpdateHandler = new MemberUpdateHandler();
|
||||||
presenceUpdateHandler = new PresenceUpdateHandler();
|
presenceUpdateHandler = new PresenceUpdateHandler();
|
||||||
rest!: ApiHandler;
|
rest!: ApiHandler;
|
||||||
constructor(options: MakePartial<WorkerManagerOptions, 'token' | 'intents' | 'info'>) {
|
constructor(options: MakePartial<WorkerManagerOptions, 'token' | 'intents' | 'info' | 'handlePayload'>) {
|
||||||
super();
|
super();
|
||||||
this.options = MergeOptions<Required<WorkerManagerOptions>>(WorkerManagerDefaults, options);
|
this.options = MergeOptions<Required<WorkerManagerOptions>>(WorkerManagerDefaults, options);
|
||||||
this.cacheAdapter = new MemoryAdapter();
|
this.cacheAdapter = new MemoryAdapter();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user