Convert EventInternalMetadata to use Arc<RwLock<_>>#19669
Convert EventInternalMetadata to use Arc<RwLock<_>>#19669erikjohnston merged 6 commits intodevelopfrom
EventInternalMetadata to use Arc<RwLock<_>>#19669Conversation
This moves the reference counting from PyO3 into standard Rust types, allowing the class to be used natively from Rust without needing a Python runtime.
reivilibre
left a comment
There was a problem hiding this comment.
I think this is fine, albeit boilerplatey, though we can think about that later if we do more and more of these. (Maybe the next steps will present some clearer opportunities to simplify things)
| Ok(Some(entry)) => data.push(entry), | ||
| Ok(None) => {} | ||
| Err(err) => { | ||
| warn!("Ignoring internal metadata field '{key}', as failed to convert to Rust due to {err}") |
There was a problem hiding this comment.
I think error! might be more appropriate here; if this happens something is pretty wrong?
There was a problem hiding this comment.
There are some old events with internal metadata fields that we no longer use, so I don't really want to error here as its not actually a problem really.
Yeah, not really sure what to do with the boilerplate. FWIW |
This moves the reference counting from PyO3 into standard Rust types, allowing the class to be used natively from Rust without needing a Python runtime.