Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback map sharing #789

Closed
wants to merge 14 commits into from
Closed

Callback map sharing #789

wants to merge 14 commits into from

Conversation

endremborza
Copy link

Hello! this is the idea referenced in #787 I thought I might as well show you what I'm on about. This gives me the chance to solve issue 2 there.

There is a lot here, but in the end, there is no significant change to currently running and tested code. On the other hand the new functionality can only be tested locally yet. ( circleci/python:#.#-stretch-node-browsers does not have a redis server set up, so i expect the ci tests to break. sorry for that, if this direction is approved, that obviously needs to be fixed)

I am merely suggesting, that this is a possible way towards the the feature of being able to dynamically add interactive elements in dash, which I find to be quite powerful. I'm working on a few projects involving dash, and all of them would greatly benefit from something like this, so if you have suggestions or some ideas how this can evolve into something that can be merged, I'm willing to put in the work.

Contributor Checklist

  • I have broken down my PR scope into the following TODO tasks
    • validate_callback_output function needed to be moved from @staticmethod to top level function to allow dill pickling. it is not used anywhere else
    • callback_map assignment needed to be changed, this way it's elements can be immutable
    • a RedisDict class added and unit tested to optionally replace the dict type of callback_map
    • tests for the redis callback_map and multiple output callbacks (this was also a necessity, as multiprocessing.Value does not work with dill pickled functions)
  • I have run the tests locally and they passed. (refer to testing section in contributing) - since the linked file does not work as dev-requirements.txt does not exist, I needed to improvise
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR
    • unit test for the redis dict
    • simple callback tests for redis callback map

@byronz byronz changed the base branch from master to dev August 14, 2019 18:52
@alexcjohnson
Copy link
Collaborator

alexcjohnson commented Dec 8, 2020

Thanks for advancing the discussion with this POC @endremborza - I'm going to close this as it's become stale, but feel free to follow up in #787 if there are further use cases not addressed or awkward using #1103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants