Skip to content

Commit

Permalink
[EN-7314] Implement the DXPublisher: DXPublisher::publishEventsImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatolyKalin committed Aug 21, 2023
1 parent 99e755e commit 3fe0948
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 0 additions & 2 deletions include/dxfeed_graal_cpp_api/api/DXPublisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ struct DXFCPP_EXPORT DXPublisher : SharedEntity {
JavaObjectHandler<DXPublisher> handler_;

static std::shared_ptr<DXPublisher> create(void *feedHandle) noexcept;

//TODO: implement
void publishEventsImpl(void *graalEventsList) const noexcept;

protected:
Expand Down
12 changes: 8 additions & 4 deletions src/api/DXPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include <string>
#include <utility>

#include "dxfeed_graal_cpp_api/api/DXPublisher.hpp"
#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/std.h>
#include "dxfeed_graal_cpp_api/api/DXPublisher.hpp"

namespace dxfcpp {

Expand Down Expand Up @@ -45,9 +45,13 @@ std::string DXPublisher::toString() const noexcept {
return fmt::format("DXPublisher{{{}}}", handler_.toString());
}

//TODO: implement
void DXPublisher::publishEventsImpl(void *graalEventsList) const noexcept {

runIsolatedOrElse(
[handler = bit_cast<dxfg_publisher_t *>(handler_.get()), graalEventsList](auto threadHandle) {
return dxfg_DXPublisher_publishEvents(dxfcpp::bit_cast<graal_isolatethread_t *>(threadHandle), handler,
bit_cast<dxfg_event_type_list *>(graalEventsList)) == 0;
},
false);
}

}
} // namespace dxfcpp

0 comments on commit 3fe0948

Please sign in to comment.