Skip to content

Commit

Permalink
Merge pull request #9 from dispatchrun/serde-npe-workaround
Browse files Browse the repository at this point in the history
Work around an issue in the coroutine serialization layer
  • Loading branch information
chriso authored Jun 25, 2024
2 parents 0de6b23 + cb036f4 commit 1a7e901
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion serde.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ type serializedDispatch struct {
}

func dispatchSerializer(s *types.Serializer, d *Dispatch) error {
types.SerializeT(s, serializedDispatch{d.opts, d.functions})
opts := make([]Option, 0, len(d.opts))
for _, opt := range d.opts {
if _, ok := opt.(AnyFunction); ok {
// No need to serialize these options, since we serialize the
// map of registered functions directly.
continue
}
opts = append(opts, opt)
}
types.SerializeT(s, serializedDispatch{opts, d.functions})
return nil
}

Expand Down

0 comments on commit 1a7e901

Please sign in to comment.