Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription Event Engine and Events Listener implementation #196

Merged
merged 19 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
runner:
- os: ubuntu-latest
group: Default
- os: macos-13
group: macos-gh
# - os: macos-13
# group: macos-gh
Xavrax marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Checkout project
uses: actions/checkout@v3
Expand Down
37 changes: 36 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ num_option(USE_PROXY "Use proxy" ON)
num_option(USE_GZIP_COMPRESSION "Use gzip compression" ON)
num_option(RECEIVE_GZIP_RESPONSE "Use gzip decompression" ON)
num_option(USE_SUBSCRIBE_V2 "Use subscribe v2" ON)
num_option(USE_SUBSCRIBE_EVENT_ENGINE "Use subscribe event engine" ON)
num_option(USE_ADVANCED_HISTORY "Use advanced history" ON)
num_option(USE_OBJECTS_API "Use objects API" ON)
num_option(USE_AUTO_HEARTBEAT "Use auto heartbeat" ON)
Expand Down Expand Up @@ -97,6 +98,7 @@ set(FLAGS "\
-D PUBNUB_USE_GZIP_COMPRESSION=${USE_GZIP_COMPRESSION} \
-D PUBNUB_RECEIVE_GZIP_RESPONSE=${RECEIVE_GZIP_RESPONSE} \
-D PUBNUB_USE_SUBSCRIBE_V2=${USE_SUBSCRIBE_V2} \
-D PUBNUB_USE_SUBSCRIBE_EVENT_ENGINE=${USE_SUBSCRIBE_EVENT_ENGINE} \
-D PUBNUB_USE_OBJECTS_API=${USE_OBJECTS_API} \
-D PUBNUB_USE_ACTIONS_API=${USE_ACTIONS_API} \
-D PUBNUB_USE_AUTO_HEARTBEAT=${USE_AUTO_HEARTBEAT} \
Expand Down Expand Up @@ -323,6 +325,16 @@ if(${USE_SUBSCRIBE_V2})
${CMAKE_CURRENT_LIST_DIR}/core/pubnub_subscribe_v2.c)
endif()

if(${USE_SUBSCRIBE_EVENT_ENGINE})
message(STATUS "Using subscribe event engine API")
set(FEATURE_SOURCEFILES
${FEATURE_SOURCEFILES}
${CMAKE_CURRENT_LIST_DIR}/core/pubnub_entities.c
${CMAKE_CURRENT_LIST_DIR}/core/pbcc_event_engine.c
${CMAKE_CURRENT_LIST_DIR}/core/pbcc_subscribe_event_engine.c
${CMAKE_CURRENT_LIST_DIR}/core/pubnub_subscribe_event_engine.c)
endif()

if(${USE_ADVANCED_HISTORY})
set(FEATURE_SOURCEFILES
${FEATURE_SOURCEFILES}
Expand Down Expand Up @@ -478,7 +490,30 @@ set(SOURCEFILES
${LIB_SOURCEFILES}
${OS_SOURCEFILES}
${FEATURE_SOURCEFILES}
${INTF_SOURCEFILES})
${INTF_SOURCEFILES}
core/pubnub_subscribe_event_engine.h
core/pubnub_entities.c
core/pubnub_entities.h
core/pubnub_entities_internal.h
lib/pbhash_set.c
lib/pbhash_set.h
lib/pbarray.c
lib/pbarray.h
core/pubnub_subscribe_event_engine_internal.h
lib/pbstrdup.c
lib/pbstrdup.h
lib/pbref_counter.c
lib/pbref_counter.h
core/pubnub_subscribe_event_listener.c
core/pubnub_subscribe_event_listener.h
core/pubnub_subscribe_event_listener_internal.h
core/pbcc_subscribe_event_listener.c
core/pbcc_subscribe_event_listener.h
core/pubnub_subscribe_event_listener_types.h
core/pubnub_subscribe_event_engine_types.h
core/pbcc_memory_utils.c
core/pbcc_memory_utils.h
)

if(NOT ESP_PLATFORM)
if(${SHARED_LIB})
Expand Down
3 changes: 2 additions & 1 deletion core/pbauto_heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ static int copy_context_settings(pubnub_t* pb_clone, pubnub_t const* pb)
PUBNUB_ASSERT_OPT(pb_valid_ctx_ptr(pb));

pubnub_mutex_lock(pb_clone->monitor);
pb_clone->core.auth_token = pb->core.auth_token;
Xavrax marked this conversation as resolved.
Show resolved Hide resolved
pb_clone->core.auth = pb->core.auth;
strcpy(pb_clone->core.user_id, pb->core.user_id);
if (PUBNUB_ORIGIN_SETTABLE) {
Expand Down Expand Up @@ -559,7 +560,7 @@ bool pubnub_is_auto_heartbeat_enabled(pubnub_t* pb)
}


void pbauto_heartbeat_free_channelInfo(pubnub_t* pb)
void pbauto_heartbeat_free_channelInfo(pubnub_t* pb)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace ;o

{
PUBNUB_ASSERT_OPT(pb_valid_ctx_ptr(pb));

Expand Down
Loading
Loading