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

Run response mapper in isolate #44

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

scrfrk
Copy link
Contributor

@scrfrk scrfrk commented Mar 2, 2023

No description provided.

@scrfrk scrfrk self-assigned this Mar 2, 2023
ISOLATE_PERFORMANCE.md Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager_web.dart Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager_io.dart Outdated Show resolved Hide resolved
test/isolate_manager_test.dart Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager_web.dart Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager_web.dart Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager.dart Outdated Show resolved Hide resolved
@scrfrk scrfrk force-pushed the feature/run-response-mapper-in-isolate branch from 4e2c1b8 to 0519b54 Compare March 6, 2023 07:15
ISOLATE_PERFORMANCE.md Outdated Show resolved Hide resolved
ISOLATE_PERFORMANCE.md Outdated Show resolved Hide resolved

import 'package:dash_kit_network/dash_kit_network.dart';

// This is an abstract class for managing isolates It defines the basic methods
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// This is an abstract class for managing isolates It defines the basic methods
// This is an abstract class for managing isolates. It defines the basic methods

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably all those comments except ignore should be doc comments with /// instead of //

lib/src/isolate_manager/isolate_manager.dart Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager.dart Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager_io.dart Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager_io.dart Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager_io.dart Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager_web.dart Outdated Show resolved Hide resolved
lib/src/isolate_manager/isolate_manager_web.dart Outdated Show resolved Hide resolved

// Method for sending messages to the isolate. The `mapper` function is
// executed in the isolate and the result is returned.
Future<FutureOr<T>> send<T>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Also if it is possible let's take into account the best practices for code documentation, for example from here: https://medium.com/codex/flutter-dart-documentation-791371ff2e0f

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thx for style guides link.

@scrfrk scrfrk force-pushed the feature/run-response-mapper-in-isolate branch 2 times, most recently from 9dd02b7 to e4ba940 Compare March 6, 2023 13:35
/// for updating tokens if they expired.
/// Component for communication with an API.
///
/// Includes functionality for updating tokens if they expired.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Includes functionality for updating tokens if they expired.
/// Includes functionality for updating tokens if they are expired.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it.

/// Method for sending messages to the isolate.
///
/// The `mapper` function is executed in the isolate and the result is
/// returned. Throws an assertion error if the isolate was stopped.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// returned. Throws an assertion error if the isolate was stopped.
/// returned. Throws an assertion error if the isolate is stopped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Description was rewritten.

/// );
/// ```
Future<FutureOr<T>> send<T>({
required Response<dynamic> response,
Copy link
Contributor

Choose a reason for hiding this comment

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

It is probably will be useful to have some info about the response parameter in the doc section for this method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it in interface class.

/// Listen for messages from the isolate manager.
///
/// We shouldn't store and cancel subscription, because the isolate will be
/// killed after will be call `IsolateManager.stop`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// killed after will be call `IsolateManager.stop`.
/// killed after `IsolateManager.stop` is called.

@scrfrk scrfrk force-pushed the feature/run-response-mapper-in-isolate branch from e4ba940 to 8231640 Compare March 7, 2023 07:22
/// Change the isolate status to initialized.
@protected
@mustCallSuper
void setInitializedStatus() {
Copy link
Contributor

Choose a reason for hiding this comment

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

protected should be only for setInitializedStatus, isn't it?

@w3ggy
Copy link
Contributor

w3ggy commented Mar 7, 2023

Increase the minor version, please

@w3ggy w3ggy merged commit bca4be7 into master Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants