question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] TaskHandler should return the task_id if persistent.

See original GitHub issue

Is your feature request related to a problem? Please describe.

There is currently no way to manage a persistent utils.delay() after a server has been reloaded.

Describe the solution you’d like

The TaskHandler add() method should return the task_id if the persistent kwarg is set to True.

Additional context

There is currently a remove() method that takes the task_id as an argument, but there is no way for the developer to gain access to the task_id when creating a utils.delay(). This change would greatly improve the usability of utils.delay() across a reload.

Chat conversation regarding this proposed change: https://irclogs.jackgrigg.com/irc.freenode.net/evennia/2021-04-07#i_4710369

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
Griatchcommented, Apr 15, 2021

For example twisted’s deferLater method of getting the twist’s cancel method from the clock did not work. I had to rewrite deferLater to resolve it.

Not sure what you mean here - deferred.cancel() works just fine as far as I know? We use these tools a lot in Evennia and I’ve never had a need to rewrite something as fundamental as deferLater to work with it …

I think that breaking backwards compatibility and return the id rather than the defererred is ok in this case since currently the taskhandler.remove is just not usable. Not sure .chain is really needed (at least if I understand it as some sort of custom thing) - as long as you get the deferred you can use that to chain as much as you want. The simplest way forward here may be to just allow the user a new kwarg to choose to return the deferred if desired from .add, and maybe some new method to be able to retrieve the id and/or deferred from the handler on-demand if they want to do something with them.

1reaction
davewiththenicehatcommented, Apr 15, 2021

I am confident I could write it in. Though deferred has a lot of method. So task handler would have a get method to return a deferred.

It would also break anyone’s current code that relies on the returned deferred instance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Persistent access requests · Issue #251 · strongdm/accessbot
Is your feature request related to a problem? Please describe. Currently, when the bot goes down all of the pending access requests get...
Read more >
How To Manage Feature Requests [Template included]
This guide will teach you everything about feature requests – how to process them, manage them, respond to them, prioritize them – so...
Read more >
3 ways to manage software feature request - Amoeboids
The best way to keep feature requests in one place is to set up a centralized repository. Whether a feature request is received...
Read more >
SYNQueue on CocoaPods.org
A simple yet powerful queueing system for iOS (with persistence). Overview. SYNQueue is a subclass of NSOperationQueue so you get: Serial or ...
Read more >
Feature Requests: What are they and how to manage them
What is a feature request? Feature requests are a form of product feedback you may frequently encounter as a SaaS product manager. They ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found