Sponsored Content
The Lounge What is on Your Mind? PubNub Live Chat Beta Testing Post 303034961 by Neo on Friday 10th of May 2019 07:03:05 AM
Old 05-10-2019
UserCP Screeching Frog 0.7609
  • Added new Vue.js code to update pubnub.hereNow() when we select and deselect the "Status" channel (bottom right)

Code:
<div v-if="this.userlist" class="neo-chat-title">
          <div  id="upped">{{this.updatedHN}}</div>
          <span id="occ">{{ this.userlist}}</span>
</div>

and

Code:
<input class="ckbox" type="checkbox" v-model="statusbox" @change="this.updateHereNow">

and

Code:
 methods: {
    updateHereNow() {
      if (!this.statusbox) {
        this.updatedHN = "Refreshing Occupancy";
        document.getElementById("occ").style.display = "none";
        document.getElementById("upped").style.display = "block";
        this.getHereNow();

        setTimeout(function() {
          document.getElementById("occ").style.display = "block";
          document.getElementById("upped").style.display = "none";
        }, 3000);
      }
    }

   // .....

}

.. something like that Smilie

UserCP Screeching Frog 0.7610
  • Moved this logic to the right of the "Status" channel selector using a "refresh" icon (bottom right).
  • Added some easy logic to make the icon greyish when updating.

UserCP Screeching Frog 0.7613
  • Minor CSS changes to the HereNow refresh icon and animation.

All looks good from an "efficiency of transaction" perspective in PubNub; so will test for a few more days and decide next steps.

Again, a big THANK YOU to PubNub and pubnubcraig for the great tech support. This has been by far the best support I have ever received from any JavaScript framework / library team. If anyone wants to build peer-to-peer apps on the net or are just interesting in learning publish-subscribe, I highly recommend PubNub because of their very good technical support and top shelf customer service.
 

4 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?

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

3. What is on Your Mind?

Live Chat (Alpha) in UserCP SF 0.7517

Interesting.... I am still working on the kinks for Live Chat here at unix.com using a publish-subscribe API from PubNub. Two days ago while working on it, a new user joined the live chat and asked about how to post a new thread in the forum. Then today, one of the members of the PubNub team... (23 Replies)
Discussion started by: Neo
23 Replies

4. 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
IO::Async::Channel(3pm) 				User Contributed Perl Documentation				   IO::Async::Channel(3pm)

NAME
"IO::Async::Channel" - pass values into or out from an IO::Async::Routine DESCRIPTION
A "IO::Async::Channel" object allows Perl values to be passed into or out of an IO::Async::Routine. It is intended to be used primarily with a Routine object rather than independently. For more detail and examples on how to use this object see also the documentation for IO::Async::Routine. A Channel object is shared between the main process of the program and the process running within the Routine. In the main process it will be used in asynchronous mode, and in the Routine process it will be used in synchronous mode. In asynchronous mode all methods return immediately and use "IO::Async"-style callback functions. In synchronous within the Routine process the methods block until they are ready and may be used for flow-control within the routine. Alternatively, a Channel may be shared between two different Routine objects, and not used directly by the controlling program. The channel itself represents a FIFO of Perl reference values. New values may be put into the channel by the "send" method in either mode. Values may be retrieved from it by the "recv" method. Values inserted into the Channel are snapshot by the "send" method. Any changes to referred variables will not be observed by the other end of the Channel after the "send" method returns. Since the channel uses Storable to serialise values to write over the communication filehandle only reference values may be passed. To pass a single scalar value, "send" a SCALAR reference to it, and dereference the result of "recv". CONSTRUCTOR
$channel = IO::Async::Channel->new Returns a new "IO::Async::Channel" object. This object reference itself should be shared by both sides of a "fork()"ed process. After "fork()" the two "setup_*" methods may be used to configure the object for operation on either end. While this object does in fact inherit from IO::Async::Notifier for implementation reasons it is not intended that this object be used as a Notifier. It should not be added to a Loop object directly; event management will be handled by its containing "IO::Async::Routine" object. METHODS
$channel->configure( %params ) Similar to the standard "configure" method on "IO::Async::Notifier", this is used to change details of the Channel's operation. on_recv => CODE May only be set on an async mode channel. If present, will be invoked whenever a new value is received, rather than using the "recv" method. $on_recv->( $channel, $data ) on_eof => CODE May only be set on an async mode channel. If present, will be invoked when the channel gets closed by the peer. $on_eof->( $channel ) $channel->send( $data ) Pushes the data stored in the given Perl reference into the FIFO of the Channel, where it can be received by the other end. When called on a synchronous mode Channel this method may block if a "write()" call on the underlying filehandle blocks. When called on an asynchronous mode channel this method will not block. $channel->send_frozen( $record ) A variant of the "send" method; this method pushes the byte record given. This should be the result of a call to "Storable::freeze()". $data = $channel->recv When called on a synchronous mode Channel this method will block until a Perl reference value is available from the other end and then return it. If the Channel is closed this method will return "undef". Since only references may be passed and all Perl references are true the truth of the result of this method can be used to detect that the channel is still open and has not yet been closed. $channel->recv( %args ) When called on an asynchronous mode Channel this method appends a callback function to the receiver queue to handle the next Perl reference value that becomes available from the other end. Takes the following named arguments: on_recv => CODE Called when a new Perl reference value is available. Will be passed the Channel object and the reference data. $on_recv->( $channel, $data ) on_eof => CODE Called if the Channel was closed before a new value was ready. Will be passed the Channel object. $on_eof->( $channel ) $channel->close Closes the channel. Causes a pending "recv" on the other end to return undef or the queued "on_eof" callbacks to be invoked. AUTHOR
Paul Evans <leonerd@leonerd.org.uk> perl v5.14.2 2012-10-24 IO::Async::Channel(3pm)
All times are GMT -4. The time now is 02:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy