babashka / pods

Pods support for JVM and babashka

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pod client sending args with metadata for transit+json

judepayne opened this issue · comments

Hi, I've read this, but that's EDN.
Would you consider a small PR for allowing a pod client to send arguments with metadata for transit+json?

The use case is enabling the rest of the instaparse functionality in the instaparse pod. Instaparse makes use of nested metadata in the input to some of less well known public functions like add-line-and-column-info-to-metadata which I'd like to enable.
I could take the approach to separate metadata from the nested structure client side and reassemble in the pod, but I thought I'd ask first.

This is per Slack conversation yesterday. I believe the change would be very small; just to add {:transform t/write-meta}.

Full disclosure: A significant reason not to do this is that {:transform t/write-meta} seems to have a substantial performance hit - roughly doubling the time of write-transit function, even when the args have no metadata.

Perhaps then, if this was worth doing, it could be done in a more configurable way e..g perhaps by adding a :transform key to the :handlers map.

@judepayne Could this just be a change in the instaparse pod? I think performance-wise it's not desirable so let's first investigate if this is possible as something that's opt-in?

I could take the approach to separate metadata from the nested structure client side and reassemble in the pod, but I thought I'd ask first.

Yes, this might be good enough for instaparse for now.

Thanks for the steer.
I'll leave this open for now until I've investigated how it could work in the pod library as an opt-in. If that route is not fruitful, I'll close this and go the instaparse pod specific reassembly approach.