1
Vote

Asynchronous processing and enabling/disabling command

description

There are processing functions in YalvLib
  • Filter functions (File checkboxes, Message Level, and column filters)
  • Load/Export to Yalv
that are executed in the input thread. These functions are not working at an optimum since the input thread is scheduled differently then a background task. The user experience is bad because one does not get a feedback when a processing is finished. Cancelling a process is impossible for the above reasons. We should implement a background processing (Task based) concept to enable an improved user experience.

comments

gwentreb wrote Jun 20, 2013 at 8:23 AM

I've implementend the async processing for the export. Gonna make it for the other process

gwentreb wrote Jun 20, 2013 at 4:40 PM

I've modified the method in the LogFileLoader (I think we can rename it into something like AsynchronousExecutionManager ?)

Now if we want a method to be asynchronous, we just have to call the method ExecuteAsynchronously with the given function in parameters)

I hope I made it the right way. I think I did. Tell me if you feel like I did it wrong.

I made test with a log file > 10mo, it still run swiftly so far

dirkster wrote Jun 23, 2013 at 2:46 PM

I think the extension is OK - I looked at it with the current Master branch and found that:
  • File>Open File works (apart from a separate bug about the line number that I reported separately)
  • File> Export Session to SQLLite works also, although, there is a Windows Explorer file coming up when the task finishes - is that on purpose, do we need that?
  • File > Open Log Analysis Session fails.
    Issue: The task never finishes and cannot be cancelled - I have to exit the program.
It looks like something has been forgotten when I look into the YalvViewModel.cs code :
public void LoadLogAnalysisSession(string path)
{
    _fileLoader = new LogFileLoader();
    _fileLoader.LoadResultEvent += fileLoader_loadResultEvent;
    ManageRepositoriesViewModel.IsLoading = true;
   /* _fileLoader.LoadFile(ManageRepositoryViewModel.LoadFiles,
                        new List<string> {path}, EntriesProviderType.Yalv, ManageRepositoriesViewModel, true);*/
}

gwentreb wrote Jun 24, 2013 at 10:15 AM

If you are talking about the unregistering for the fileLoadResultEvent, it is made in the fileLoader_loadResultEvent method ( is this a not recommended way of handling events?)

For the Windows Explorer, yes, I've add this. I was thinking that if someone export his workspace he may want to have a windows explorer popping up to allow him moving, archiving the file. Normally you don't export workspace that often. Maybe it can be an option?

gwentreb wrote Jun 24, 2013 at 10:20 AM

Open Log Analysis Session fails.
Issue: The task never finishes and cannot be cancelled - I have to exit the program.

I had commented the line loading the file... And forgot to remove it.. sorry :(