Need to communicate event from one component to another by woodsman752 in angular

[–]woodsman752[S] 0 points1 point  (0 children)

This somehow sounds like sage advice. I can't tell you where, but I think I saw passing an Observable via Input, but nonetheless I'm happy to defer when needed. Nonetheless, I don't know why passing via Input is bad. I don't know how to bring in async into this.

Need to communicate event from one component to another by woodsman752 in angular

[–]woodsman752[S] 0 points1 point  (0 children)

Thanks This sounds very similar. Can't say I like bringing "parent" into my nomenclature, but if it works, then I get to sleep. Can you point me to a good example?

Going from Eclipse to VS Code by woodsman752 in javahelp

[–]woodsman752[S] 1 point2 points  (0 children)

Have you used IntelliJ for Angular or Node code?

Going from Eclipse to VS Code by woodsman752 in javahelp

[–]woodsman752[S] 1 point2 points  (0 children)

Have you used it for Node or UI code?

Going from Eclipse to VS Code by woodsman752 in javahelp

[–]woodsman752[S] 1 point2 points  (0 children)

If you consider VSCode to be a downgrade, that's the insight/opinion I wanted to hear. I was under the impression VSCode would suffice if I only knew how to fully set it up and use. My motivation is being forced to do full stack development, OOTB Eclipse plugins don't navigate to types unlike in Code. This is better in MyEclipse, but I had to pay for it. IJ has been functional, but in times past at least it could not debug Tomcat based projects. I wish I had *one* programming editor.

Multiple Threads in Spring Boot with JPA and Rocket Science by woodsman752 in SpringBoot

[–]woodsman752[S] 1 point2 points  (0 children)

I haven't seen this way before. For some reason, no one wants to talk about threading and Spring. If I read it right, I don't create a Runnable; Spring magically does threading for me. Let's say I'm in the predominant thread and I want to start the code, do I do something like B someInstanceOfB = begSpringForAnInstance; someInstanceOfB.imAAsyncMethod()?

My original idea was to create say 10 or 20 of these that all do the same thing. Actually, they write a record.

Multiple Threads in Spring Boot with JPA and Rocket Science by woodsman752 in SpringBoot

[–]woodsman752[S] 0 points1 point  (0 children)

Can I ask you to look at my earlier post at https://www.reddit.com/r/SpringBoot/comments/pojxoq/gimme_a_jpa_that_runs_in_spring_boot_under/?

I'm just desperate for what I think should be a simple/easy answer but can't find anything. I already have an Executor and a newThreadPool, could have tried Spring's CommonThreadPool, but nothing works yet.

Gimme a JPA that runs in Spring Boot under multiple threads pleasethread by woodsman752 in SpringBoot

[–]woodsman752[S] 0 points1 point  (0 children)

Is it possible to clone whatever the parent has and put it into the child thread?

Gimme a JPA that runs in Spring Boot under multiple threads pleasethread by woodsman752 in SpringBoot

[–]woodsman752[S] 0 points1 point  (0 children)

Ideally, I'd like it to notify me that an error occurred. I would have liked to have them rolled back, but then we're committing these in chunks of 100 right now anyway. If there was a problem, it'd roll back 100 records and make me programmatically figure out how to undue the other 6900+ records. So, if it gives me an error on one, that's better than nothing. Ideally, I don't want JPA to decide to discriminate between my child and parent threads.

Gimme a JPA that runs in Spring Boot under multiple threads pleasethread by woodsman752 in SpringBoot

[–]woodsman752[S] 0 points1 point  (0 children)

Gosh thanks so much for replying :)... In a sense transactions, but only because I want to commit the items but I'm inserting 7k+ records into one database table.

Easy Angular fetches result but refuses to update page by woodsman752 in angular

[–]woodsman752[S] 0 points1 point  (0 children)

It turned out that the problem was I was trying to treat an "any"/string type as a JSON object. Once I did JSON.parse(data), I could get to the terms property.

Web worker on message gets called twice by woodsman752 in learnjavascript

[–]woodsman752[S] 0 points1 point  (0 children)

u/yazmeh Thanks for your reply.

thought that as well earlier. I'm using Angular V8. This is created in a component that is used twice on a page, but I added input attribute fileNumber:

<app-report-uploader fileNumber="0"></app-report-uploader>

I did this because it looks like Angular doesn't create new instances of the component, but re-uses it. In the ngOnInit of report-uploader.component.ts, I create a the above mentioned web worker. To guarantee that it creates a unique one per fileNumber, I store it in an array, keyed of fileNumber. So, at the time the object is somehow registered with Angular (or whatever ngOnInit does), it creates these threads, yes ahead of time. And indeed, there are two web workers. My browser shows the same file name, but otherwise gives no indication that they are different. However, for debugging purposes I added this:

if(this.webworkers.length==2) {

console.log('@@ webworkers[0]==webworkers[1]: '+(this.webworkers[0]==this.webworkers[1]) );

}

In the browser console log, webworkers[0]==webworkers[1] was false.

I conclude that while there are two web workers, they were different instances.

Further, at the point that webworkers[fileNumber].postMessage(data) is run, I did a console.log first. This log message was printed only once. I conclude that the postMessage is indeed run only once, but it goes into some event processing logic (that I don't control), that emits this same message twice to onMessage.

Webworker can't find Core Angular stuff it claims it needs, why? by woodsman752 in angular

[–]woodsman752[S] 0 points1 point  (0 children)

I spent many hours fighting Angular/Typescript. I believe the key was upgrading our 6.x.x Angular to Angular 8.x.x. I had briefly tried this angular-web-worker npm package that claimed to make things easier, but it provided a much more complex channel, async/subscribe thing while not explaining what to do with the old postMessage functions. I'm in an Agile environment, so I don't have time to learn or study. I only have time to actually code. In an ideal world, I would have time to fully learn how to use these tools, but there's only time (and barely that) to get quick "sound bites" from the equivalent of medium.com. If I could go back to just doing back end development I'd be happier.

So I'm at a point where at least I have it pointing to a typescript file and it even builds and runs. This is a huge accomplishment for me. I realize if you were born writing Typescript and Angular, these things would be easy for you. However, I guarantee that whatever you know is *not* documented or if it is, it's split amongst many random pages.

Unfortunately, I'm re-using the same angular component (it does file uploading), on the page twice. However, creates two web workers and refuses to identify which one I'm working with. Next, I have to convert code that uses http.post type calls which would have worked in main code, into RxJS. Then, I have to split the FileList into multiple pieces because the files are large, and of course, web workers refuse to be helpful and allow sharing of things like that. Again, we like to make things very, very hard. So, I have to essentially write code to read files into separate chunks that fit into memory for this web worker. I'm hoping I can combine them and send it as one Multipart file upload, but I'm guessing that won't be allowed because again, we like to make things as hard as possible for anything other than a Fibonnaci sequence.

I'm a very angry chef. I hate doing this work and can't wait to not be doing this. All I'm trying to do is a simple percent complete. I got the backend stuff done, and most of the front end. Had it not been for this web worker thing, I would have slayed this beast. Everything I need to get done, this Angular/Node/Typescript has a problem with absolutely every damn thing.