-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I connect the consumer's "MessageReceived" event to a class method
addlistener(obj.consumer,'MessageReceived',@obj.on_rabbitmq_message_received)
Then I use the class method to update a class property whenever a message is received.
function on_rabbitmq_message_received(obj, ~, message)
json = jsondecode(message.message);
if isfield(json, 'positions')
obj.positionsTable = struct2table(json.positions);
% disp(obj.positionsTable);
end
end
I have a loop which calls disp(obj.positionsTable). If I receive a message while trying to display the table, the table isn't updated. I have to send message twice to get it updated.
Am I misunderstanding how the listener works? Or is there a way to lock the table in order to replace its value?
Metadata
Metadata
Assignees
Labels
No labels