Skip to content

Commit

Permalink
try bump cpp client to 3.4.1 c1
Browse files Browse the repository at this point in the history
  • Loading branch information
shibd committed Nov 20, 2023
1 parent 801e5ce commit bc071f6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ jobs:
- name: Package Node binaries lib
run: |
npx node-pre-gyp package --target_arch=${{ matrix.arch }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: macos-${{matrix.nodejs}}-${{matrix.arch}}
path: build/stage/*/*.tar.gz

linux-napi:
name: Build NAPI ${{matrix.image}} - Node ${{matrix.nodejs}} - ${{matrix.cpu.platform}}
runs-on: ubuntu-22.04
Expand Down
9 changes: 5 additions & 4 deletions pkg/mac/build-cpp-deps-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ if [ ! -f protobuf-${PROTOBUF_VERSION}.done ]; then
curl -O -L https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-${PROTOBUF_VERSION}.tar.gz
tar xfz protobuf-cpp-${PROTOBUF_VERSION}.tar.gz
pushd protobuf-${PROTOBUF_VERSION}
CXXFLAGS="-fPIC -arch arm64 -arch x86_64 -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
./configure --prefix=$PREFIX
make -j16 V=1
make install
pushd cmake/
cmake -B build -DCMAKE_CXX_FLAGS="-fPIC -arch arm64 -arch x86_64 -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
-DCMAKE_INSTALL_PREFIX=$PREFIX
cmake --build build -j16 --target install
popd
popd

pushd install/lib
Expand Down
4 changes: 2 additions & 2 deletions pulsar-client-cpp.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CPP_CLIENT_BASE_URL=https://archive.apache.org/dist/pulsar/pulsar-client-cpp-3.2.0
CPP_CLIENT_VERSION=3.2.0
CPP_CLIENT_BASE_URL=https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.4.1-candidate-1/
CPP_CLIENT_VERSION=3.4.1
7 changes: 6 additions & 1 deletion src/Producer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ Napi::Value Producer::Flush(const Napi::CallbackInfo &info) {
[](pulsar_result result, void *ctx) {
auto deferredContext = static_cast<ExtDeferredContext *>(ctx);
auto deferred = deferredContext->deferred;
delete deferredContext;

deferredContext->callnum++;
if (deferredContext ->callnum == 2) {
delete deferredContext;
return;
}

if (result != pulsar_result_Ok) {
deferred->Reject(std::string("Failed to flush producer: ") + pulsar_result_str(result));
Expand Down
1 change: 1 addition & 0 deletions src/ThreadSafeDeferred.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class ThreadSafeDeferred : public Napi::Promise::Deferred {
struct ExtDeferredContext {
ExtDeferredContext(std::shared_ptr<ThreadSafeDeferred> deferred) : deferred(deferred){};
std::shared_ptr<ThreadSafeDeferred> deferred;
int callnum = 0;
};

#endif /* __THREADSAFE_DEFERRED_HPP */

0 comments on commit bc071f6

Please sign in to comment.