Observer on tasks.

23 views
Skip to first unread message

Arman Ohanian

unread,
Aug 31, 2017, 10:24:02 AM8/31/17
to python-doit
Hi,

Is it possible to register observer objects on the tasks, say for GUI implementation?

Say we want to to have a GUI that can display the state of the task as the tasks are executing (Or send status to time-series database, etc)

We have long running processes and we need to monitor them.  

Please advise.

Thanks,
-Arman.

Eduardo Schettino

unread,
Aug 31, 2017, 10:47:18 AM8/31/17
to python-doit
On Thu, Aug 31, 2017 at 6:24 PM, Arman Ohanian <arman....@gmail.com> wrote:
Hi,

Is it possible to register observer objects on the tasks, say for GUI implementation?

This is something I really would like to implement but would take considerable time,
so never tackled it...
 

Say we want to to have a GUI that can display the state of the task as the tasks are executing (Or send status to time-series database, etc)

Custom reporters is your friend. The idea is that you could output a structured format that would be fed into a process
that can process them and update a GUI or send status to a DB.

So to implement a GUI you would not need any change in doit core.
 

We have long running processes and we need to monitor them.  

Please advise.

Thanks,
-Arman.

--
You received this message because you are subscribed to the Google Groups "python-doit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-doit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arman Ohanian

unread,
Aug 31, 2017, 2:12:30 PM8/31/17
to python-doit
Thanks.  

I will check out the customer reporter.

However, if I understand this correctly, I have to generate a file and prompt to GUI to update.  Is that correct?

What I like to do is something like.
#Say t is a task object.


o1
= TaskObserver()

t.attach(o1)


# Now,for each event, from within the objects' notify method, say...
    o1
.update(event='start')
# or
    o1
.update(status='running')




I hope that makes sense.   :)


To unsubscribe from this group and stop receiving emails from it, send an email to python-doit...@googlegroups.com.

Eduardo Schettino

unread,
Aug 31, 2017, 3:35:22 PM8/31/17
to pytho...@googlegroups.com


On Thursday, August 31, 2017, Arman Ohanian <arman....@gmail.com> wrote:
Thanks.  

I will check out the customer reporter.

However, if I understand this correctly, I have to generate a file and prompt to GUI to update.  Is that correct?

What I like to do is something like.
#Say t is a task object.


o1
= TaskObserver()

t.attach(o1)


# Now,for each event, from within the objects' notify method, say...
    o1
.update(event='start')
# or
    o1
.update(status='running')




I hope that makes sense.   :)


uhmm. no idea what is this code... :P 

Actually I was planning to work on a GUI by the end of the year, but not open source ...





On Thursday, August 31, 2017 at 9:47:18 AM UTC-5, schettino72 wrote:

On Thu, Aug 31, 2017 at 6:24 PM, Arman Ohanian <arman....@gmail.com> wrote:
Hi,

Is it possible to register observer objects on the tasks, say for GUI implementation?

This is something I really would like to implement but would take considerable time,
so never tackled it...
 

Say we want to to have a GUI that can display the state of the task as the tasks are executing (Or send status to time-series database, etc)

Custom reporters is your friend. The idea is that you could output a structured format that would be fed into a process
that can process them and update a GUI or send status to a DB.

So to implement a GUI you would not need any change in doit core.
 

We have long running processes and we need to monitor them.  

Please advise.

Thanks,
-Arman.

--
You received this message because you are subscribed to the Google Groups "python-doit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-doit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "python-doit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-doit+unsubscribe@googlegroups.com.

Arman Ohanian

unread,
Aug 31, 2017, 5:07:23 PM8/31/17
to python-doit
Oh, I didn't mean you should add a GUI.
I meant to make the 'Task' observable.

There is a python example here:


In effect, if you have a way to do a pre-exec/exec/post-exec, it would work for my purpose too.
I think we can have multiple actions in the "actions" key and mimic the functionality, right?
Reply all
Reply to author
Forward
0 new messages