Bind a method that streams its JSON-RPC result directly to the transport.
The callback writes only the result payload; the RPC layer writes the JSON-RPC envelope and request id.
Definition at line 76 of file rpc.cpp.hpp.
76 {
77#if FL_PLATFORM_HAS_LARGE_MEMORY
78 fl::string key(name);
79
80 detail::RpcEntry entry;
81 entry.mTypeTag = detail::TypeTag<void(const json&)>::id();
83 entry.mIsStreaming = true;
85
86 entry.mSchemaGenerator =
fl::make_shared<detail::TypedSchemaGenerator<void(
const json&)>>();
87 entry.mDescription = "";
88 entry.mTags = {};
89
90 struct PlaceholderInvoker : public detail::ErasedInvoker {
92 return fl::make_tuple(TypeConversionResult::success(), json(
nullptr));
93 }
94 };
96
98#else
99 (void)name;
100 (void)fn;
101#endif
102}
fl::unordered_map< fl::string, detail::RpcEntry > mRegistry
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
tuple< typename fl::decay< Ts >::type... > make_tuple(Ts &&... args) FL_NO_EXCEPT
auto invoke(F &&f, T1 &&t1, Args &&... args) FL_NO_EXCEPT -> enable_if_t< is_member_function_pointer< typename remove_reference< F >::type >::value &&!detail::use_pointer_syntax< T1 >::value, decltype((fl::forward< T1 >(t1).*f)(fl::forward< Args >(args)...))>
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
References fl::FL_NO_EXCEPT, fl::adl_barrier::invoke(), fl::adl_barrier::make_shared(), fl::adl_barrier::make_tuple(), fl::detail::RpcEntry::mDescription, fl::detail::RpcEntry::mInvoker, fl::detail::RpcEntry::mMode, fl::adl_barrier::move(), mRegistry, fl::detail::RpcEntry::mSchemaGenerator, fl::detail::RpcEntry::mTags, fl::detail::RpcEntry::mTypeTag, fl::TypeConversionResult::success(), and fl::SYNC.