Sponsored Content
The Lounge What is on Your Mind? Live Chat (Alpha) in UserCP SF 0.7517 Post 303034168 by Neo on Friday 19th of April 2019 11:13:32 PM
Old 04-20-2019
Update SF version: 0.7528
  • Removed annoying "join and leave" messages from chat window. I added this yesterday and it's simply too annoying. My bad.

Next, I think I need to spend time on the initial Vue.js bug which is causing the initial page render to be blank (requiring a reload) based on some incomplete PubNub AJAX calls (race conditions). This results in "undefined" Javascript errors I need to trap and deal with. These async AJAX timing and race conditions can be tricky to deal with (trap all possible errors) in all of these types of apps which make asynchronous REST calls to a remote API. I'm having some issues on initial page load where the REST'ful AJAX calls to the PubNub API are not returning fast enough and this is causing errors on initial page load and this is the reason why a page reload works (and is often required) after the initial loading.

This issue is really is nagging me and it impacts every possible variation of this publish-subscribe Javascript project moving forward. This is a Vue.js lifecycle problem and not a PubNum API problem. However, I have not completely switched out all the "OUTDATED" Vue.js wrapper code, so maybe if I get rid of it and just use the "unwrapped" SDK, I will get better results? Actually, I kinda doubt it because I have seen these kinds of AJAX race conditions many times over the years. This is the bane of using async remote calls. It's also an issue I have seen in game engine (the game loop) programming.
 

5 More Discussions You Might Find Interesting

1. Solaris

Live Chat For Solaris?

Does anyone know of any online live chat discussion groups for Solaris? If so, please let me know... Thanks! Rob Sandifer (3 Replies)
Discussion started by: RobSand
3 Replies

2. What is on Your Mind?

New UserCP Update Profile Image Page (UserCP Screeching Frog 0.7485)

Update! UserCP Screeching Frog 0.7485 Created a new page for uploaded a profile picture (profile pictures are different than avatar pictures). https://www.unix.com/usercp/#/settings/other https://www.unix.com/members/1-albums225-picture1158.png ... (0 Replies)
Discussion started by: Neo
0 Replies

3. What is on Your Mind?

A Quick Video Overview of PubNub Live Chat @UNIX.com (version 0.7614)

A number of people have asked me to make some videos, so I just got my first condenser microphone and so I can make some amateurish screen casts. I will try to do better in the future. A quick overview of PubNub Live Chat @unix.com The video is best is you set the Quality to HD 1080. The... (0 Replies)
Discussion started by: Neo
0 Replies

4. What is on Your Mind?

PubNub Live Chat Beta Testing

Dear All, We are now beta testing our future "Live Chat" area using PubNub technology. https://community.unix.com/ This purpose of this testing is to test the core system, in general, and to see how many, if any, bugs crawl out of the woodwork. This "Live Chat" is not the... (48 Replies)
Discussion started by: Neo
48 Replies

5. What is on Your Mind?

Update: UserCP Screeching Frog 0.7641 - Changed Live Chat to Live Updates

Update: UserCP Screeching Frog 0.7641 - Changed Live Chat to Live Updates In this version of the UserCP, I have changed "Live Chat" to "Live Updates" by disabling the ability to post in the "live chat" area and changed the name to "Live Updates" The reason for this change is that experienced... (6 Replies)
Discussion started by: Neo
6 Replies
Mail::SpamAssassin::AsyncLoop(3)			User Contributed Perl Documentation			  Mail::SpamAssassin::AsyncLoop(3)

NAME
Mail::SpamAssassin::AsyncLoop - scanner asynchronous event loop DESCRIPTION
An asynchronous event loop used for long-running operations, performed "in the background" during the Mail::SpamAssassin::check() scan operation, such as DNS blocklist lookups. METHODS
$obj = $async->start_lookup($obj) Register the start of a long-running asynchronous lookup operation. $obj is a hash reference containing the following items: key (required) A key string, unique to this lookup. This is what is reported in debug messages, used as the key for "get_lookup()", etc. id (required) An ID string, also unique to this lookup. Typically, this is the DNS packet ID as returned by DnsResolver's "bgsend" method. Sadly, the Net::DNS architecture forces us to keep a separate ID string for this task instead of reusing "key" -- if you are not using DNS lookups through DnsResolver, it should be OK to just reuse "key". type (required) A string, typically one word, used to describe the type of lookup in log messages, such as "DNSBL", "MX", "TXT". poll_callback (optional) A code reference, which will be called periodically during the background-processing period. If you will be performing an async lookup on a non-DNS-based service, you will need to implement this so that it checks for new responses and calls "set_response_packet()" or "report_id_complete()" as appropriate. DNS-based lookups can leave it undefined, since DnsResolver::poll_responses() will be called automatically anyway. The code reference will be called with one argument, the $ent object. completed_callback (optional) A code reference which will be called when an asynchronous task (e.g. a DNS lookup) is completed, either normally, or aborted, e.g. by a timeout. When a task has been reported as completed via "set_response_packet()" the response (as provided to "set_response_packet()") is stored in $ent->{response_packet} (possibly undef, its semantics is defined by the caller). When completion is reported via "report_id_complete()" or a task was aborted, the $ent->{response_packet} is guaranteed to be undef. If it is necessary to distinguish between the last two cases, the $ent->{status} may be examined for a string 'ABORTING' or 'FINISHED'. The code reference will be called with one argument, the $ent object. zone (optional) A zone specification (typically a DNS zone name - e.g. host, domain, or RBL) which may be used as a key to look up per-zone settings. No semantics on this parameter is imposed by this module. Currently used to fetch by-zone timeouts. timeout_initial (optional) An initial value of elapsed time for which we are willing to wait for a response (time in seconds, floating point value is allowed). When elapsed time since a query started exceeds the timeout value and there are no other queries to wait for, the query is aborted. The actual timeout value ranges from timeout_initial and gradually approaches timeout_min (see next parameter) as the number of already completed queries approaches the number of all queries started. If a caller does not explicitly provide this parameter or its value is undefined, a default initial timeout value is settable by a configuration variable rbl_timeout. If a value of the timeout_initial parameter is below timeout_min, the initial timeout is set to timeout_min. timeout_min (optional) A lower bound (in seconds) to which the actual timeout approaches as the number of queries completed approaches the number of all queries started. Defaults to 0.2 * timeout_initial. $obj is returned by this method. $obj = $async->get_lookup($key) Retrieve the pending-lookup object for the given key $key. If the lookup is complete, this will return "undef". Note that a lookup is still considered "pending" until "complete_lookups()" is called, even if it has been reported as complete via "set_response_packet()" or "report_id_complete()". @objs = $async->get_pending_lookups() Retrieve the lookup objects for all pending lookups. Note that a lookup is still considered "pending" until "complete_lookups()" is called, even if it has been reported as complete via "set_response_packet()" or "report_id_complete()". $async->log_lookups_timing() Log sorted timing for all completed lookups. $alldone = $async->complete_lookups() Perform a poll of the pending lookups, to see if any are completed; if they are, their <completed_callback> is called with the entry object for that lookup. If there are no lookups remaining, or if too long has elapsed since any results were returned, 1 is returned, otherwise 0. $async->abort_remaining_lookups() Abort any remaining lookups. $async->set_response_packet($id, $pkt, $key, $timestamp) Register a "response packet" for a given query. $id is the ID for the query, and must match the "id" supplied in "start_lookup()". $pkt is the packet object for the response. A parameter $key identifies an entry in a hash %{$self->{pending_lookups}} where the object which spawned this query can be found, and through which futher information about the query is accessible. If this was called, $pkt will be available in the "completed_callback" function as "$ent-<gt"{response_packet}>. One or the other of "set_response_packet()" or "report_id_complete()" should be called, but not both. $async->report_id_complete($id,$key,$key,$timestamp) Register that a query has completed, and is no longer "pending". $id is the ID for the query, and must match the "id" supplied in "start_lookup()". One or the other of "set_response_packet()" or "report_id_complete()" should be called, but not both. $time = $async->last_poll_responses_time() Get the time of the last call to "poll_responses()" (which is called from "complete_lookups()". If "poll_responses()" was never called or "abort_remaining_lookups()" has been called "last_poll_responses_time()" will return undef. perl v5.12.1 2010-03-16 Mail::SpamAssassin::AsyncLoop(3)
All times are GMT -4. The time now is 03:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy