Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

enhance tasklet.bind() #28

Closed
ghost opened this issue Dec 2, 2013 · 7 comments
Closed

enhance tasklet.bind() #28

ghost opened this issue Dec 2, 2013 · 7 comments

Comments

@ghost
Copy link

ghost commented Dec 2, 2013

Originally reported by: Anselm Kruis (Bitbucket: akruis, GitHub: akruis)


This issue proposes an enhancement for the method tasklet.bind(). It adds the functionality of tasklet.setup() except the implicit tasklet.insert() to bind().

The details were discussed on the Stackless mailing list in the thread http://www.stackless.com/pipermail/stackless/2013-November/005899.html. The credits for the idea to enhance tasklet.bind() go to Kristján: http://www.stackless.com/pipermail/stackless/2013-November/005911.html.

Details

Currently tasklet.bind() requires a single positional argument. Kristján proposes to add two optional arguments. The signature of bind then becomes

def bind(self, function, args=None, keywords=None):

If both args and keywords are None, bind() behaves as before.
Otherwise presence of args and/or keywords as being non-None, would then
imply a setup, without scheduling the tasklet. In this case, if function is None the value of self.tempval is used as function, similar to tasklet.setup(). If self.tempval is None too, bind() raises RuntimeError('the tasklet was not bound to a function')

With this change tasklet.bind() and tasklet.insert() become the "atomic" building blocks for tasklet creation. tasklet.setup() is then equivalent to

#!python

def setup(self, *args, **kw):
    self.bind(None, args, kw)
    return self.insert()

Plan

  1. Implement the proposal and appropriate unit tests
  2. Update the documentation in Doc/library/stackless/tasklets.rst and tasklet_state_chart.png
  3. Update Stackless/changelog.txt
  4. Port the change to Stackless version 3.x

Any objections?

tasklet_state.eap.zip


@ghost
Copy link
Author

ghost commented Dec 2, 2013

Original comment by Kristján Valur Jónsson (Bitbucket: krisvale, GitHub: kristjanvalur):


Ah, this is already done:
https://bitbucket.org/stackless-dev/stackless/commits/48f6fea3cd20e3a946b20ed9ab15482578b93d7c

@ghost
Copy link
Author

ghost commented Dec 2, 2013

Original comment by Kristján Valur Jónsson (Bitbucket: krisvale, GitHub: kristjanvalur):


except for the changes to the .rst and state chart.

@ghost
Copy link
Author

ghost commented Dec 6, 2013

Original comment by Anselm Kruis (Bitbucket: akruis, GitHub: akruis):


except for the changes to the .rst and state chart.
Done. commit b009989aaf89.

@ghost
Copy link
Author

ghost commented Dec 6, 2013

Original comment by Anselm Kruis (Bitbucket: akruis, GitHub: akruis):


The source file of the diagram. Requires Enterprise Architect 7.1 to edit

@ghost
Copy link
Author

ghost commented Dec 6, 2013

Original comment by Anselm Kruis (Bitbucket: akruis, GitHub: akruis):


Actually we are already almost done. Probably the changes need to be merged to 2.8 and 3.x.

@ghost
Copy link
Author

ghost commented Jan 3, 2014

Original comment by Kristján Valur Jónsson (Bitbucket: krisvale, GitHub: kristjanvalur):


Marking this as resolved.

@ghost
Copy link
Author

ghost commented Nov 6, 2016

Original comment by Anselm Kruis (Bitbucket: akruis, GitHub: akruis):


Removing milestone: 2.7.6-slp (automated comment)

@ghost ghost closed this as completed Sep 24, 2017
akruis pushed a commit that referenced this issue Mar 3, 2018
 various updates from upstream python/typing repo:

- Added typing.Counter and typing.ChainMap generics
- More flexible typing.NamedTuple
- Improved generic ABC caching
- More tests
- Bugfixes
- Other updates

* Add Misc/NEWS entry

* Add issue number
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

0 participants