Questions tagged [blinker]

Fast, simple object-to-object and broadcast signaling in python

Blinker provides a fast dispatching system that allows any number of interested parties to subscribe to events, or "signals".

Signal receivers can subscribe to specific senders or receive signals sent by any sender.

Requirements

Blinker requires Python 2.4 or higher, Python 3.0 or higher, or Jython 2.5 or higher.

10 questions
30
votes
2 answers

Python - How are signals different from pubsub?

Django and Flask make use of signals — the latter uses the Blinker library. In the context of Python, Blinker and the Python pubsub library, how do signals and pubsub compare? When would I use one or the other?
a paid nerd
  • 30,702
  • 30
  • 134
  • 179
12
votes
2 answers

Flask-Security user_registered Signal Not Received in Python 3.3, but works in 2.7

I'm trying to use the user_registered signal in order to set up default roles for users when they register using flask-security as in the following link: Setting Default Role in Flask Security In my searches I can see that there was a bug that was…
khammel
  • 2,047
  • 1
  • 14
  • 18
11
votes
2 answers

Importing a Flask-security instance into my views module breaks my webapp

I'm writing the sign up/sign in system for a ecommerce site, and using flask-security (http://pythonhosted.org/Flask-Security/) to handle the signup feature. Part of the basic setup requires the following signup.py module: from flask.ext.security…
Faiyam Rahman
  • 305
  • 2
  • 4
  • 8
8
votes
1 answer

Flask signals: why is it not ok to modify data on signal?

Flask documentations says: Also keep in mind that signals are intended to notify subscribers and should not encourage subscribers to modify data I am wondering, why is so? I'm using Flask-User library, and I would like to set some default…
Alexander Putilin
  • 2,262
  • 2
  • 19
  • 32
3
votes
1 answer

Async / Multi-Threading with blinker

I have a raspberry pi which I have hooked up with a 4 button keypad. Using the signal stuff from blinker I hooked it up to run some methods. #sender while True: if buttonIsDown == True: signal.send() #reciever @signal.connect def sayHI(): …
user8162574
0
votes
1 answer

Sending signals from APScheduler background thread to Flask app

I am trying to build an application that lets you schedule and execute multiple long running jobs in a background thread using APScheduler. To control the job schedules and view the (live) output of the jobs I want to send messages to the Flask…
peterrus
  • 651
  • 2
  • 6
  • 18
0
votes
1 answer

Python - Can I use blinker library for this purpose?

I'm wondering if I can do these jobs with blinker library(or maybe with whatever libraries). I run a web application using Flask and within this application(maybe app.py), I define a signal named updated(e.g. blinker.signal('updated')). In a…
hallazzang
  • 651
  • 8
  • 18
0
votes
1 answer

Inconsistent Blinker speed in React

I am trying to create a blinker in React, however, the blinker itself blinks / renders at an inconsistent rate and acts somewhat frustratingly. Please see the attached snippet. Is there something I am doing wrong with the component mounting?…
Jimmy
  • 3,090
  • 12
  • 42
  • 99
0
votes
2 answers

Collect incremental results from Tornado's ProcessPoolExecutor

I have a tornado application which needs to run a blocking function on ProcessPoolExecutor. This blocking function employs a library which emits incremental results via blinker events. I'd like to collect these events and send them back to my…
matthewatabet
  • 1,463
  • 11
  • 26
0
votes
1 answer

blinker does not work in Python 2.6

import blinker from blinker import signal class Ticket(): @classmethod def update(cls): pass ticket_created = signal('CREATED') ticket_created.connect(Ticket.update) This snippet of code works well on Python 2.7. But does not work on…
Sudheer
  • 710
  • 6
  • 25