Skip to content

Commit 49950cf

Browse files
committed
Change messagebus topic method to sync
Signed-off-by: ArthurSens <[email protected]>
1 parent 9e532eb commit 49950cf

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

components/gitpod-messagebus/src/messagebus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,11 @@ export abstract class AbstractTopicListener<T> implements MessagebusListener {
442442
constructor(protected readonly exchangeName: string, protected readonly listener: TopicListener<T>) { }
443443

444444
async establish(channel: Channel): Promise<void> {
445-
const topic = await this.topic();
445+
const topic = this.topic();
446446
return this.doEstablish(channel, topic);
447447
}
448448

449-
abstract topic(): Promise<string>;
449+
abstract topic(): string;
450450

451451
protected async doEstablish(channel: Channel, topic: string): Promise<void> {
452452
if (channel === undefined) {

components/server/src/consensus/rabbitmq-consensus-leader-messenger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class RabbitMQConsensusLeaderMessenger extends AbstractMessageBusIntegrat
9898

9999
class EventListener extends AbstractTopicListener<RaftMessage> {
100100

101-
async topic(): Promise<string> {
101+
topic(): string {
102102
return '';
103103
}
104104

components/server/src/workspace/messagebus-integration.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class WorkspaceInstanceUpdateListener extends AbstractTopicListener<Works
2121
super(messageBusHelper.workspaceExchange, listener);
2222
}
2323

24-
async topic() {
24+
topic() {
2525
return this.messageBusHelper.getWsTopicForListening(this.userId, undefined, "updates");
2626
}
2727
}
@@ -32,7 +32,7 @@ export class HeadlessWorkspaceLogListener extends AbstractTopicListener<Headless
3232
super(messageBusHelper.workspaceExchange, listener);
3333
}
3434

35-
async topic() {
35+
topic() {
3636
return this.messageBusHelper.getWsTopicForListening(undefined, this.workspaceID, "headless-log");
3737
}
3838

@@ -114,11 +114,11 @@ export class MessageBusIntegration extends AbstractMessageBusIntegration {
114114
}
115115
}
116116

117-
async listenForHeadlessWorkspaceLogs(workspaceID: string, callback: (ctx: TraceContext, evt: HeadlessLogEvent) => void): Disposable {
117+
listenForHeadlessWorkspaceLogs(workspaceID: string, callback: (ctx: TraceContext, evt: HeadlessLogEvent) => void): Disposable {
118118
const listener = new HeadlessWorkspaceLogListener(this.messageBusHelper, callback, workspaceID);
119119
const cancellationTokenSource = new CancellationTokenSource()
120120
this.listen(listener, cancellationTokenSource.token);
121-
increaseMessagebusTopicReads(await listener.topic())
121+
increaseMessagebusTopicReads(listener.topic())
122122
return Disposable.create(() => cancellationTokenSource.cancel())
123123
}
124124

@@ -129,11 +129,11 @@ export class MessageBusIntegration extends AbstractMessageBusIntegration {
129129
return Disposable.create(() => cancellationTokenSource.cancel())
130130
}
131131

132-
async listenForWorkspaceInstanceUpdates(userId: string | undefined, callback: (ctx: TraceContext, workspaceInstance: WorkspaceInstance) => void): Disposable {
132+
listenForWorkspaceInstanceUpdates(userId: string | undefined, callback: (ctx: TraceContext, workspaceInstance: WorkspaceInstance) => void): Disposable {
133133
const listener = new WorkspaceInstanceUpdateListener(this.messageBusHelper, callback, userId);
134134
const cancellationTokenSource = new CancellationTokenSource()
135135
this.listen(listener, cancellationTokenSource.token);
136-
increaseMessagebusTopicReads(await listener.topic())
136+
increaseMessagebusTopicReads(listener.topic())
137137
return Disposable.create(() => cancellationTokenSource.cancel())
138138
}
139139

components/ws-manager-bridge/src/messagebus-integration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class WorkspaceStatusUpdateListener extends AbstractTopicListener<WorkspaceStatu
104104
super(MessageBusIntegration.WORKSPACE_EXCHANGE, listener);
105105
}
106106

107-
async topic() {
107+
topic() {
108108
return this._topic;
109109
}
110110
}
@@ -115,7 +115,7 @@ class WorkspaceLogListener extends AbstractTopicListener<WorkspaceLogMessage.AsO
115115
super(MessageBusIntegration.WORKSPACE_EXCHANGE, listener);
116116
}
117117

118-
async topic() {
118+
topic() {
119119
return this._topic;
120120
}
121121
}

0 commit comments

Comments
 (0)