Results 1 to 4 of 4

Thread: Methods of Ext.util.TaskRunner.Task don't return the task

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Sep 2016
    Location
    Germany
    Posts
    37

    Default Methods of Ext.util.TaskRunner.Task don't return the task

    Hey Sencha team,

    I discovered that when handling a task via the methods of Ext.util.TaskRunner.Task [1],
    like task.start(), it won't return the task.

    Whereas if you handle it via Ext.util.TaskManager it does return the task,
    like Ext.util.TaskManager.start(task).

    I think the methods of Ext.util.TaskRunner.Task should also return it,
    which can be achieved through adding a simple return in front of the last statement of each method.

    Kind regards,
    clampart

    [1] http://docs.sencha.com/extjs/6.2.1/classic/Ext.util.TaskRunner.Task.html

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    To clarify, are you saying the calls to task.start/stop should return task? If so, why?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha Premium User
    Join Date
    Sep 2016
    Location
    Germany
    Posts
    37

    Default

    Quote Originally Posted by evant View Post
    To clarify, are you saying the calls to task.start/stop should return task? If so, why?
    Yes,exactly.
    Simply to be coherent with Ext.TaskManager.start/stop().
    I'd argue a new user would expect it that way. (At least I did. )

    I came from using Ext.TaskManager.start({run: myFun}) and switched to
    Ext.TaskManager.newTask(taskCfg).start().
    I want to push a reference of the task to an array:
    Code:
    was     : array.push(Ext.TaskManager.start(taskCfg))
    expected: array.push(Ext.TaskManager.newTask(taskCfg).start())
    is      : array.push(Ext.TaskManager.start(Ext.TaskManager.newTask(taskCfg))) (or in 2 lines)
    Kind regards,
    clampart

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    I don't necessarily think it''s idiomatic for a class to return itself like that, especially since you can achieve the same thing with less code, why choose the longer one?

    Code:
    array.push(Ext.TaskManager.newTask(taskCfg).start())
    array.push(Ext.TaskManager.start(taskCfg))
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Similar Threads

  1. Replies: 3
    Last Post: 6 Sep 2016, 1:58 AM
  2. How to stop a Task spawned by TaskRunner
    By ddiguru in forum Ext JS 6.x Q&A
    Replies: 5
    Last Post: 23 Jun 2016, 12:54 PM
  3. TaskRunner task taskStartTime, taskRunTime
    By aarffy in forum Ext: Q&A
    Replies: 1
    Last Post: 5 Nov 2014, 4:27 PM
  4. Simple Task Bug
    By AlanBee in forum Ext: Q&A
    Replies: 4
    Last Post: 29 Mar 2014, 11:18 PM
  5. [FIXED] 4.1 Beta 3: TaskRunner - initial run of task is delayed
    By mdipersio in forum Ext:Bugs
    Replies: 1
    Last Post: 23 Feb 2012, 10:58 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •