| 1265 | } |
| 1266 | |
| 1267 | bool sourceEnsureTopic(void* ctx, PJ_string_view_t topic_name, TopicHandle* out_topic, PJ_error_t* out_error) noexcept { |
| 1268 | return guardHostCallback(out_error, [&] { |
| 1269 | auto* impl = static_cast<DatastoreSourceWriteHostState*>(ctx); |
| 1270 | // Pin the current WriteCore for the whole call so a concurrent setTarget() |
| 1271 | // swap can't destroy it under us (and so the op + its error read the SAME core). |
| 1272 | auto core = impl->core.load(std::memory_order_acquire); |
| 1273 | if (!core->ensureTopic(impl->source, toStringView(topic_name), out_topic)) { |
| 1274 | propagateError(out_error, core->lastError()); |
| 1275 | return false; |
| 1276 | } |
| 1277 | return true; |
| 1278 | }); |
| 1279 | } |
| 1280 | |
| 1281 | bool sourceEnsureField( |
| 1282 | void* ctx, TopicHandle topic, PJ_string_view_t field_name, PJ_primitive_type_t type, FieldHandle* out_field, |
nothing calls this directly
no test coverage detected