Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete almost all BeaconSignals #634

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 6 additions & 87 deletions src/Bloc/BlParallelUniverse.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,7 @@ BlParallelUniverse >> attachSpace: aSpace [

self defer: [ self attachSpaceSynchronously: aSpace ].

aSpace host isRunning
ifFalse: [
(BlParallelUniverseHostStartRequestSignal new
universeId: self id;
spaceId: aSpace id;
host: aSpace host class) emit.

self startUniverse.

(BlParallelUniverseHostStartedSignal new
universeId: self id;
spaceId: aSpace id;
host: aSpace host class;
isRunning: aSpace host isRunning) emit ]
aSpace host isRunning ifFalse: [ self startUniverse ]
]

{ #category : #'private - spaces' }
Expand All @@ -95,34 +82,14 @@ BlParallelUniverse >> attachSpaceSynchronously: aSpace [
"First of all we need to add space to the space manager"
spaceManager addSpace: aSpace.

(BlParallelUniverseSpaceAddedSignal new
universeId: self id;
spaceId: aSpace id) emit.

"then create and show it in a host space"
aSpace host createHostSpaceFor: aSpace.

(BlParallelUniverseHostSpaceCreatedSignal new
universeId: self id;
spaceId: aSpace id) emit.

aSpace hostSpace show.

(BlParallelUniverseHostSpaceShownSignal new
universeId: self id;
spaceId: aSpace id) emit.

self
assert: [ aSpace hasHostSpace ]
description: [ 'Space must have a host space!' ].

(BlParallelUniverseSpaceRootAssignedSignal new
universeId: self id;
spaceId: aSpace id) emit.

(BlParallelUniverseSpaceDispatchAddedToSceneSignal new
universeId: self id;
spaceId: aSpace id) emit
description: [ 'Space must have a host space!' ]
]

{ #category : #'api - spaces' }
Expand Down Expand Up @@ -203,8 +170,6 @@ BlParallelUniverse >> defer: aValuable [
"Enqueue a valuable from any process to be executed in the UI process at the beginning of the next pulse.
It is useful to update the UI states."

(BlParallelUniverseDeferredActionAddedSignal new universeId: self id) emit.

deferredActions nextPut: aValuable
]

Expand Down Expand Up @@ -328,27 +293,9 @@ BlParallelUniverse >> initialize [
BlParallelUniverse >> openSpace: aSpace [
"It should be possible to add a space from the other thread"

(BlParallelUniverseOpenSpaceRequestSignal new
universeId: self id;
spaceId: aSpace id;
isRunning: aSpace host isRunning) emit.

self defer: [ self openSpaceSynchronously: aSpace ].

aSpace host isRunning
ifFalse: [
(BlParallelUniverseHostStartRequestSignal new
universeId: self id;
spaceId: aSpace id;
host: aSpace host class) emit.

self startUniverse.

(BlParallelUniverseHostStartedSignal new
universeId: self id;
spaceId: aSpace id;
host: aSpace host class;
isRunning: aSpace host isRunning) emit ]
aSpace host isRunning ifFalse: [ self startUniverse ]
]

{ #category : #'private - spaces' }
Expand All @@ -363,23 +310,11 @@ BlParallelUniverse >> openSpaceSynchronously: aSpace [
"First of all we need to add space to the space manager"
spaceManager addSpace: aSpace.

(BlParallelUniverseSpaceAddedSignal new
universeId: self id;
spaceId: aSpace id) emit.

"then create and show it in a host space"
aSpace host createHostSpaceFor: aSpace.

(BlParallelUniverseHostSpaceCreatedSignal new
universeId: self id;
spaceId: aSpace id) emit.

aSpace hostSpace show.

(BlParallelUniverseHostSpaceShownSignal new
universeId: self id;
spaceId: aSpace id) emit.

"Note: we should send shown event after everything else is done, because
theoretically, that only space could be closed as a reaction to the event"
aSpace dispatchEvent:
Expand All @@ -390,15 +325,7 @@ BlParallelUniverse >> openSpaceSynchronously: aSpace [
"Notify root element that it is now visible to the user"
aSpace becomeVisible.

(BlParallelUniverseSpaceRootAssignedSignal new
universeId: self id;
spaceId: aSpace id) emit.

aSpace dispatchAddedToSceneGraph.

(BlParallelUniverseSpaceDispatchAddedToSceneSignal new
universeId: self id;
spaceId: aSpace id) emit
aSpace dispatchAddedToSceneGraph
]

{ #category : #'api - ui process' }
Expand Down Expand Up @@ -429,6 +356,7 @@ BlParallelUniverse >> pulseSynchronously [
do: [ :e |
(BlParallelUniverseErrorDuringPulse new
signaledError: e;
universeId: self id;
yourself) emit.
e pass ]
]
Expand Down Expand Up @@ -465,16 +393,7 @@ BlParallelUniverse >> stopUniverse [
BlParallelUniverse >> tryToRunDeferredActions [

| nextInQueue |
(BlParallelUniverseTryToRunDeferredActionsSignal new
universeId: self id;
yourself) emit.

[ (nextInQueue := deferredActions nextOrNil) isNotNil ] whileTrue: [

(BlParallelUniverseRunDeferredActionSignal new
universeId: self id;
yourself) emit.

[ (nextInQueue := deferredActions nextOrNil) isNotNil ] whileTrue: [
nextInQueue value ]
]

Expand Down
24 changes: 0 additions & 24 deletions src/Bloc/BlParallelUniverseDeferredActionAddedSignal.class.st

This file was deleted.

13 changes: 12 additions & 1 deletion src/Bloc/BlParallelUniverseErrorDuringPulse.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ I include in myself the signaledError.
"
Class {
#name : #BlParallelUniverseErrorDuringPulse,
#superclass : #BlParallelUniverseSignal,
#superclass : #BeaconSignal,
#instVars : [
'universeId',
'signaledError'
],
#category : #'Bloc-Universe - Parallel'
Expand All @@ -22,3 +23,13 @@ BlParallelUniverseErrorDuringPulse >> signaledError: anObject [

signaledError := anObject
]

{ #category : #accessing }
BlParallelUniverseErrorDuringPulse >> universeId [
^ universeId
]

{ #category : #accessing }
BlParallelUniverseErrorDuringPulse >> universeId: aNumber [
universeId := aNumber
]
19 changes: 0 additions & 19 deletions src/Bloc/BlParallelUniverseHostSpaceCreatedSignal.class.st

This file was deleted.

19 changes: 0 additions & 19 deletions src/Bloc/BlParallelUniverseHostSpaceShownSignal.class.st

This file was deleted.

34 changes: 0 additions & 34 deletions src/Bloc/BlParallelUniverseHostStartRequestSignal.class.st

This file was deleted.

45 changes: 0 additions & 45 deletions src/Bloc/BlParallelUniverseHostStartedSignal.class.st

This file was deleted.

32 changes: 0 additions & 32 deletions src/Bloc/BlParallelUniverseOpenSpaceRequestSignal.class.st

This file was deleted.

24 changes: 0 additions & 24 deletions src/Bloc/BlParallelUniverseRunDeferredActionSignal.class.st

This file was deleted.

Loading