Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add isConnected API #294

Merged
merged 3 commits into from
Jun 13, 2024
Merged

[feat] Add isConnected API #294

merged 3 commits into from
Jun 13, 2024

Conversation

jiyoung-an
Copy link
Member

Summary

  • add isConnected API.
  • rename open -> connect, close -> disconnect API.

@jiyoung-an jiyoung-an added the new feature New feature or request label Jun 13, 2024
@jiyoung-an jiyoung-an self-assigned this Jun 13, 2024
@@ -22,10 +23,15 @@ export const request = async <T>(
ainize: Ainize,
{ serviceName, opType, data, timeout = DEFAULT_TIMEOUT_MS }: AinizeRequest
): Promise<AinizeResponse<T>> => {
if (!Handler.getInstance().isConnected()) {
throw new Error('Network error: blockchain event channel is not connected.');
Copy link
Member Author

Choose a reason for hiding this comment

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

@jiyoung-an jiyoung-an changed the title [feat] Add isConnected api. [feat] Add isConnected API Jun 13, 2024
src/ainft.ts Outdated Show resolved Hide resolved
src/ainft.ts Outdated Show resolved Hide resolved
@jiyoung-an jiyoung-an force-pushed the feature/jiyoung/connect-api branch from 985021c to f5a521d Compare June 13, 2024 08:17
async open() {
async connect() {
if (this.isConnected()) {
throw new Error('Client is already connected.');
Copy link
Member

Choose a reason for hiding this comment

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

👍

async close() {
async disconnect() {
if (!this.isConnected()) {
throw new Error('Client is not connected.');
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@platfowner platfowner left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks!

@jiyoung-an
Copy link
Member Author

Thank you for quick review @platfowner! now merging...

@jiyoung-an jiyoung-an merged commit 350f533 into develop Jun 13, 2024
@jiyoung-an jiyoung-an mentioned this pull request Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants