Call remote tasks of service workspace #75

Closed
winter-yuki wants to merge 25 commits from winter-yuki/distributed into 0.6
Showing only changes of commit 07a0bd551b - Show all commits

View File

@ -1,5 +1,7 @@
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
package space.kscience.dataforge.distributed.serialization
import kotlinx.coroutines.Deferred
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
import kotlinx.coroutines.async
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.asFlow
import kotlinx.coroutines.flow.map
@ -29,11 +31,11 @@ internal data class DataSetPrototype(val data: Map<String, DataPrototype>) {
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
companion object {
fun <T : Any> of(dataSet: DataSet<T>): DataSetPrototype = runBlocking {
val serializer = serializer(dataSet.dataType)
val map = mutableListOf<Pair<String, DataPrototype>>()
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
val map = mutableListOf<Pair<String, Deferred<DataPrototype>>>()
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
dataSet.flowData().map { (name, data) ->
name.toString() to DataPrototype.of(data, serializer)
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
name.toString() to async { DataPrototype.of(data, serializer) }
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
}.toList(map)
DataSetPrototype(map.associate { it })
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
DataSetPrototype(map.associate { (name, deferred) -> name to deferred.await() })
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
}
fun fromJson(string: String): DataSetPrototype = Json.decodeFromString(serializer(), string)

altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
altavir commented 2022-05-24 12:42:07 +03:00 (Migrated from github.com)
Review

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.

Again, you do not need a separate structure. All you need is a generic DataSet with serializer.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.
winter-yuki commented 2022-05-25 20:53:44 +03:00 (Migrated from github.com)
Review

When ServiceWorkspace.execute returns result to the client, it do not know yet about serializer for the T. Then RemoteTask uses serializer to deserialize DataSet from prototype.

When `ServiceWorkspace.execute` returns result to the client, it do not know yet about serializer for the `T`. Then `RemoteTask` uses serializer to deserialize DataSet from prototype.