ios - Asynchronous dependency resolution using Typhoon -


i'd add formal di component app , typhoon looks job. before dive in wanted see if there's way handle injection of dependencies must resolved asynchronously.

to give example: core data stack set in way recommended here. since initialising store can take time , block main thread, it's done in background thread , main thread notified when object ready used.

i have object wraps logic, , app delegate waits on callback notified database ready. object injected other objects in graph through property injection.

i'd replace property injection approach typhoon assemblies, can't see way handle asynchronous nature of database object initialisation. if that's not possible, keep database object initialisation out of typhoon, manually provide resulting object assembly use wired graph once it's ready?

would appreciate tips!

we don't have special support this, . . .

scopes:

typhoon provides various scopes. if objects using asynchronously initalized store of following scopes:

  • typhoonscopeobjectgraph
  • typhoonscopeprototype
  • typhoonscopelazysingleton
  • typhoonscopeweaksingleton

. . . is, scope except typhoonscopesingleton, no special setup should required, long initial presented view controller not depend on core data store.

to proceed 1 object graph another, can use this process, or if you're using storyboards , objective-c auto-injection.

manually provide object injection:

you can register object produces object like this or provide custom object participate in assembly.

. . if either of above don't suit needs , have else in mind of general utility, we'd happy implement you.

here's sample / example setting typhoon core data, modified support pattern in article linked in question.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -