-
Notifications
You must be signed in to change notification settings - Fork 59
add runtime api selection + void*
data for listeners' callbacks
#204
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
Changes from 38 commits
7c2fed5
f8fc91f
90ac3d3
5d17ba8
296fa92
a5f078a
d0c474c
0767e3b
dceb9fe
ca7e13a
d43401d
0421757
0c6798f
7e2df3b
ae3f409
0f50d01
fac6fb6
6cd8119
d08c2a8
4730575
270eae9
9938039
6f3c665
0795fae
63fbd33
b206cfc
499193b
7a4561b
f5faace
8fb7c39
1b4a877
a763ec3
befc777
dfc8515
3d5d948
596ca9d
b22616c
81a27ea
b51ed72
e230f2c
27ca218
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,7 @@ static bool pubsub_keys_changed(pubnub_t const* pb_clone, pubnub_t const* pb) | |
|| (pb_clone->core.subscribe_key != pb->core.subscribe_key); | ||
} | ||
|
||
#if defined(PUBNUB_CALLBACK_API) | ||
#if defined(PUBNUB_CALLBACK_API) && !defined(PUBNUB_NTF_RUNTIME_SELECTION) | ||
#define add_heartbeat_in_progress(thumper_index) | ||
#else | ||
static void add_heartbeat_in_progress(unsigned thumper_index) | ||
|
@@ -131,7 +131,13 @@ static void heartbeat_thump(pubnub_t* pb, pubnub_t* heartbeat_pb) | |
|
||
if (keys_changed) { | ||
/** Used in sync environment while for callback it's an empty macro */ | ||
#if defined(PUBNUB_NTF_RUNTIME_SELECTION) | ||
if (PNA_SYNC == pb->api_policy) { | ||
add_heartbeat_in_progress(pb->thumperIndex); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we have early exit from the function if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm.. I didn't think about it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that inside the function there is an heartbeat operation anyway. |
||
#else | ||
add_heartbeat_in_progress(pb->thumperIndex); | ||
#endif | ||
pubnub_mutex_unlock(pb->monitor); | ||
pubnub_cancel(heartbeat_pb); | ||
return; | ||
|
@@ -156,7 +162,13 @@ static void heartbeat_thump(pubnub_t* pb, pubnub_t* heartbeat_pb) | |
pubnub_res_2_string(res)); | ||
} | ||
/** Used in sync environment while for callback it's an empty macro */ | ||
#if defined(PUBNUB_NTF_RUNTIME_SELECTION) | ||
if (PNA_SYNC == pb->api_policy) { | ||
add_heartbeat_in_progress(pb->thumperIndex); | ||
} | ||
#else | ||
add_heartbeat_in_progress(pb->thumperIndex); | ||
#endif | ||
} | ||
pubnub_mutex_unlock(pb->monitor); | ||
} | ||
|
@@ -240,7 +252,7 @@ void pbauto_take_the_node_out(unsigned* indexes, unsigned i, unsigned* dimension | |
memmove(node_out, node_out + 1, (*dimension - i) * sizeof(unsigned)); | ||
} | ||
|
||
#if defined(PUBNUB_CALLBACK_API) | ||
#if defined(PUBNUB_CALLBACK_API) && !defined(PUBNUB_NTF_RUNTIME_SELECTION) | ||
#define handle_heartbeats_in_progress() | ||
#else | ||
static void handle_heartbeats_in_progress(void) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1115,4 +1115,4 @@ char* pbcc_subscribe_ee_joined_array_elements_( | |
} | ||
|
||
return joined_str; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to compare with
make/common/source_files.mk
,make/posix_source_files.mk
, andwindows_source_files.mk
? I've noticed that some source files are missing and some placed for wrong environment.Here is some:
${CMAKE_CURRENT_LIST_DIR}/lib/pubnub_dns_codec.c
and ${CMAKE_CURRENT_LIST_DIR}/lib/sockets/pbpal_adns_sockets.c - this one used only in Callback API (at least according to the code)${CMAKE_CURRENT_LIST_DIR}/core/pubnub_alloc_std.c
- present in bothif
andelse
branches. Should we just move it to the core files list declaration?${CMAKE_CURRENT_LIST_DIR}/core/pubnub_memory_block.c
- for some reason specified only for Callback API but it is general API (at least according to the code)${CMAKE_CURRENT_LIST_DIR}/posix/pubnub_version_posix.c
- can't be added as is toOS_SOURCEFILES
because there exists another version file forWITH_CPP
:${CMAKE_CURRENT_LIST_DIR}/cpp/pubnub_version_posix.cpp
. Similar situation with version file for Windows which also depends fromWITH_CPP
${CMAKE_CURRENT_LIST_DIR}/lib/sockets/pbpal_sockets.c
- I've noticed that we don't have this in cmake settings for non-openssl build (at least it was in original make files)${CMAKE_CURRENT_LIST_DIR}/posix/pbpal_posix_blocking_io.c
- is missing for non-openssl POSIX build${CMAKE_CURRENT_LIST_DIR}/core/pubnub_ssl.c
,${CMAKE_CURRENT_LIST_DIR}/openssl/pbpal_connect_openssl.c
,${CMAKE_CURRENT_LIST_DIR}/openssl/pbpal_openssl.c
,${CMAKE_CURRENT_LIST_DIR}/openssl/pbpal_openssl_blocking_io.c
- looks like this one also missing for openssl buildThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ues sure.
I found that there are few differences between makefiles and cmake - probably I will need some help with that.