mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Remove dispatch object allocation from Stasis publishing
While looking for areas for performance improvement, I realized that an unused feature in Stasis was negatively impacting performance. When a message is sent to a subscriber, a dispatch object is allocated for the dispatch, containing the topic the message was published to, the subscriber the message is being sent to, and the message itself. The topic is actually unused by any subscriber in Asterisk today. And the subscriber is associated with the taskprocessor the message is being dispatched to. First, this patch removes the unused topic parameter from Stasis subscription callbacks. Second, this patch introduces the concept of taskprocessor local data, data that may be set on a taskprocessor and provided along with the data pointer when a task is pushed using the ast_taskprocessor_push_local() call. This allows the task to have both data specific to that taskprocessor, in addition to data specific to that invocation. With those two changes, the dispatch object can be removed completely, and the message is simply refcounted and sent directly to the taskprocessor. Review: https://reviewboard.asterisk.org/r/2884/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
10
main/cel.c
10
main/cel.c
@@ -1019,7 +1019,6 @@ static int cel_filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
|
||||
}
|
||||
|
||||
static void cel_snapshot_update_cb(void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct stasis_cache_update *update = stasis_message_data(message);
|
||||
@@ -1082,7 +1081,6 @@ static struct ast_str *cel_generate_peer_str(
|
||||
|
||||
static void cel_bridge_enter_cb(
|
||||
void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_bridge_blob *blob = stasis_message_data(message);
|
||||
@@ -1110,7 +1108,6 @@ static void cel_bridge_enter_cb(
|
||||
|
||||
static void cel_bridge_leave_cb(
|
||||
void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_bridge_blob *blob = stasis_message_data(message);
|
||||
@@ -1138,7 +1135,6 @@ static void cel_bridge_leave_cb(
|
||||
|
||||
static void cel_parking_cb(
|
||||
void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_parked_call_payload *parked_payload = stasis_message_data(message);
|
||||
@@ -1183,7 +1179,6 @@ static void save_dialstatus(struct ast_multi_channel_blob *blob)
|
||||
}
|
||||
|
||||
static void cel_dial_cb(void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_multi_channel_blob *blob = stasis_message_data(message);
|
||||
@@ -1218,7 +1213,6 @@ static void cel_dial_cb(void *data, struct stasis_subscription *sub,
|
||||
|
||||
static void cel_generic_cb(
|
||||
void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_channel_blob *obj = stasis_message_data(message);
|
||||
@@ -1241,7 +1235,6 @@ static void cel_generic_cb(
|
||||
|
||||
static void cel_blind_transfer_cb(
|
||||
void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_bridge_blob *obj = stasis_message_data(message);
|
||||
@@ -1289,7 +1282,6 @@ static void cel_blind_transfer_cb(
|
||||
|
||||
static void cel_attended_transfer_cb(
|
||||
void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_attended_transfer_message *xfer = stasis_message_data(message);
|
||||
@@ -1342,7 +1334,6 @@ static void cel_attended_transfer_cb(
|
||||
|
||||
static void cel_pickup_cb(
|
||||
void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_multi_channel_blob *obj = stasis_message_data(message);
|
||||
@@ -1364,7 +1355,6 @@ static void cel_pickup_cb(
|
||||
|
||||
static void cel_local_cb(
|
||||
void *data, struct stasis_subscription *sub,
|
||||
struct stasis_topic *topic,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_multi_channel_blob *obj = stasis_message_data(message);
|
||||
|
Reference in New Issue
Block a user