You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce unsnapshottableIdentifier() to allow transient WorkflowIdentifiers.
This fixes#79 and unblocks the ability to implement GUWT Workers as Workflows.
`WorkflowIdentifier` can now indicate that it is not serializable by returning
null from `toByteString()`, in which case neither it nor the snapshot of the
workflow it identifies will be serialized. Because these identifiers do not need
to be serialized, they can contain arbitrary values such as `KType`s, which is
how Workers distinguish themselves for example. Workers also do not need to
be snapshotted, so this works out.
Copy file name to clipboardExpand all lines: workflow-core/api/workflow-core.api
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -172,12 +172,12 @@ public final class com/squareup/workflow/WorkflowIdentifier {
172
172
public static final field Companion Lcom/squareup/workflow/WorkflowIdentifier$Companion;
173
173
public fun equals (Ljava/lang/Object;)Z
174
174
public fun hashCode ()I
175
+
public final fun maybeToByteString ()Lokio/ByteString;
175
176
public fun toString ()Ljava/lang/String;
176
-
public final fun write (Lokio/BufferedSink;)V
177
177
}
178
178
179
179
public final class com/squareup/workflow/WorkflowIdentifier$Companion {
180
-
public final fun read (Lokio/BufferedSource;)Lcom/squareup/workflow/WorkflowIdentifier;
180
+
public final fun parse (Lokio/ByteString;)Lcom/squareup/workflow/WorkflowIdentifier;
181
181
}
182
182
183
183
public final class com/squareup/workflow/WorkflowOutput {
@@ -225,6 +225,7 @@ public final class com/squareup/workflow/Workflows {
225
225
public static synthetic fun stateful$default (Lcom/squareup/workflow/Workflow$Companion;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lcom/squareup/workflow/StatefulWorkflow;
226
226
public static final fun stateless (Lcom/squareup/workflow/Workflow$Companion;Lkotlin/jvm/functions/Function2;)Lcom/squareup/workflow/Workflow;
227
227
public static final fun transform (Lcom/squareup/workflow/Worker;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow/Worker;
228
+
public static final fun unsnapshottableIdentifier (Lkotlin/reflect/KType;)Lcom/squareup/workflow/WorkflowIdentifier;
228
229
public static final fun workflowAction (Lcom/squareup/workflow/StatefulWorkflow;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow/WorkflowAction;
229
230
public static final fun workflowAction (Lcom/squareup/workflow/StatefulWorkflow;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow/WorkflowAction;
230
231
public static synthetic fun workflowAction$default (Lcom/squareup/workflow/StatefulWorkflow;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/squareup/workflow/WorkflowAction;
0 commit comments