[mythtv-commits] Ticket #7990: Rework of status handling in mythjobqueue

MythTV noreply at mythtv.org
Sat Apr 25 17:37:04 UTC 2015


#7990: Rework of status handling in mythjobqueue
-----------------------------------+-----------------------------
 Reporter:  wagnerrp               |          Owner:  wagnerrp
     Type:  Developer Task         |         Status:  assigned
 Priority:  major                  |      Milestone:  0.28
Component:  MythTV - Mythjobqueue  |        Version:  Master Head
 Severity:  low                    |     Resolution:
 Keywords:                         |  Ticket locked:  0
-----------------------------------+-----------------------------

Comment (by Jim Stichnoth <jstichnoth@…>):

 In [changeset:"b43b11ca3062086d20ee0072368e9dd3646a5faa/mythtv"]:
 {{{
 #!CommitTicketReference repository="mythtv"
 revision="b43b11ca3062086d20ee0072368e9dd3646a5faa"
 Reduce "Watch Recordings" sluggishness by caching jobqueue state.

 Refs #8962, refs #7990.

 Currently, when navigating the Watch Recordings screen, every time the
 cursor position is moved, 4 jobqueue queries are issued for each item
 visible on the screen (the actual number being controlled by the
 theme).  These queries are done within the UI thread, which makes
 navigation noticeably sluggish on most any setup that isn't a
 moderately powerful combined frontend/backend.

 Ideally, any time a job's status changes (including queue addition and
 removal), we would call ProgramInfo::SendUpdateEvent() to get the
 Watch Recordings entry updated, along with any other
 ProgramInfoUpdater subscribers.  Also,
 ProgramInfo::LoadProgramFromRecorded() and LoadFromRecorded() would
 set up the necessary commflag and transcode flags in the ProgramInfo
 object.

 However, in the current jobqueue implementation, this is not very
 practical because of functions like:
   JobQueue::DeleteJob(int jobID)
   JobQueue::ChangeJobCmds(int jobID, int newCmds)
   JobQueue::ChangeJobFlags(int jobID, int newFlags)
   JobQueue::ChangeJobStatus(int jobID, int newStatus, QString comment)
   JobQueue::ChangeJobComment(int jobID, QString comment)
   JobQueue::ChangeJobArgs(int jobID, QString args)
   JobQueue::ChangeJobHost(int jobID, QString newHostname)
   JobQueue::CleanupOldJobsInQueue()
 where the ProgramInfo isn't readily available (though it could be
 found given another query on jobID for all but the last function).

 Instead, in this approach, the PlaybackBox locally caches the jobqueue
 contents, reloading every 15 seconds as needed.  The reload blocks the
 UI thread, but only for a small fraction of the time that the current
 implementation was blocking it, so it's unlikely a user pay much
 attention to this once-in-15-seconds query.

 This code should be removed once #7990 makes jobs more autonomous.
 }}}

--
Ticket URL: <https://code.mythtv.org/trac/ticket/7990#comment:10>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list