-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into shruti0085/fixPosixTest
- Loading branch information
Showing
19 changed files
with
254 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
plugin/src/software/aws/toolkits/eclipse/amazonq/broker/EventBroker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.eclipse.amazonq.broker; | ||
|
||
import io.reactivex.rxjava3.disposables.Disposable; | ||
import io.reactivex.rxjava3.functions.Consumer; | ||
import io.reactivex.rxjava3.schedulers.Schedulers; | ||
import io.reactivex.rxjava3.subjects.PublishSubject; | ||
import io.reactivex.rxjava3.subjects.Subject; | ||
import software.aws.toolkits.eclipse.amazonq.broker.api.EventObserver; | ||
|
||
public final class EventBroker { | ||
|
||
private final Subject<Object> eventBus = PublishSubject.create().toSerialized(); | ||
|
||
public <T> void post(final T event) { | ||
if (event == null) { | ||
return; | ||
} | ||
eventBus.onNext(event); | ||
} | ||
|
||
public <T> Disposable subscribe(final Class<T> eventType, final EventObserver<T> observer) { | ||
Consumer<T> consumer = new Consumer<>() { | ||
@Override | ||
public void accept(final T event) { | ||
observer.onEvent(event); | ||
} | ||
}; | ||
|
||
return eventBus.ofType(eventType) | ||
.observeOn(Schedulers.computation()) | ||
.subscribe(consumer); | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
plugin/src/software/aws/toolkits/eclipse/amazonq/broker/api/EventObserver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.eclipse.amazonq.broker.api; | ||
|
||
@FunctionalInterface | ||
public interface EventObserver<T> { | ||
void onEvent(T event); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
plugin/src/software/aws/toolkits/eclipse/amazonq/lsp/auth/AuthStatusChangedListener.java
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
plugin/src/software/aws/toolkits/eclipse/amazonq/lsp/auth/AuthStatusProvider.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.