Bloc icon indicating copy to clipboard operation
Bloc copied to clipboard

Transform BlUniverse logs into events

Open labordep opened this issue 2 years ago • 4 comments

Actually there are BlUniverse announcer as BlParallelUniverseHostSpaceCreatedSignal. But they are not real announcers because they are used for logging with Beacon.

We need to have real announcer using SystemAnnouncer to be notified when Spaces are opened, showed, etc. For example, we need to use theses events to inject behavior is the fly with Pyramid https://github.com/OpenSmock/Pyramid/issues/83

labordep avatar Nov 01 '23 13:11 labordep

Hi @tinchodias can you check this issue to have your feedback ? thanks :)

labordep avatar Nov 16 '23 12:11 labordep

It's sure that Pyramid can't use Beacon?

I had to give a second or third opportunity to Beacon to grasp the idea (until I realized some class comments :).

Did you try this? 1. Open Transcript, 2. Evaluate: TranscriptLogger startFor: BlParallelUniverseSpaceSignal, 3. Evaluate BlSpace new show. You will see:

2023-11-16T22:31:58.583444-03:00 BlParallelUniverseOpenSpaceRequestSignal 
2023-11-16T22:31:58.600786-03:00 BlParallelUniverseSpaceAddedSignal 
2023-11-16T22:31:58.646729-03:00 BlParallelUniverseHostSpaceCreatedSignal 
2023-11-16T22:31:58.650793-03:00 BlParallelUniverseHostSpaceShownSignal 
2023-11-16T22:31:58.65119-03:00 BlParallelUniverseSpaceRootAssignedSignal 
2023-11-16T22:31:58.651342-03:00 BlParallelUniverseSpaceDispatchAddedToSceneSignal 

Do TranscriptLogger stop to finish.

But Pyramid for sure wants to subscribe to signals. This is an example to do it:

signals := OrderedCollection new.
Beacon instance
	when: BlParallelUniverseSpaceSignal
	send: #add:
	to: signals.

Then open the same space and inspect the collection to see: Screenshot 2023-11-16 at 22 41 27

SO it is quite similar to the system announcer.

tinchodias avatar Nov 17 '23 01:11 tinchodias

Thanks @tinchodias for your answer, I never used Beacon (and I don't know it) and I will try your solution. This topic cames from a dicussion with @plantec because we think that Beacon shoud not be used in Bloc. Is Beacon a necessary dependencies ? Can be replace by system announment ?

labordep avatar Nov 17 '23 11:11 labordep

I made a mistake, because I though that Beacon was a dependency, but it looks like not because this is in Pharo :)

labordep avatar Nov 17 '23 12:11 labordep