1

I use serverside job (viewmodel) to inform another not mdriven service via restpost periodically. And I have the stupid question - how to get MDrivenServer computer's name in the viemodel? Is there something like "string.currentuser" but for the computer's name? Thank you!

Alex
  • 107
  • 9

1 Answers1

1

You do not have access to the computers name from with the serverside job. But you can give your MDrivenServer variables that you can access.

This way you can have a variable vComputerName:string defined in your server, assign it a value once and for all: vComputerName:='TheCorrectName'

If your ServerSideViewModel has a matching variable : vComputerName:string it will be set prior to execution.

Image of MDrivenServer ServerSide Actions

Hans Karlsen
  • 2,275
  • 1
  • 15
  • 15
  • 1
    - What is important in the concept described is that these variables are owned by the installation of the MDrivenServer - this way every installation can share the same model but distinguish between themselves eaily. – Hans Karlsen Sep 13 '19 at 11:20
  • Thank you for the advise to use variables and for the note about vars ownership. You predict my next question )) So I can share the same model between MDriven installations using that vars. Each MDriven installation can be distinguish by that var value. Is it ok if all of that installations, that share the same model, will use the same DB? – Alex Sep 14 '19 at 07:14
  • 1
    Yes - you can share the same DB - but a MDrivenServer is able to propagate changes between clients - it can not detect clients on other MDrivenServers. Are you spreading your Servers because of Geography (latency) or Load(number of users)? In both cases setting one MDrivenServer as Master and others as slaves may be a better option. https://wiki.mdriven.net/index.php/Slave_and_History_Server – Hans Karlsen Sep 15 '19 at 19:59
  • I've been experimenting with Docker and MDriven products for my pet project with MDrivenServer containers with load balancer behind them + some infra containers. Master/Slave is the interesting option, need to check it. Thank you! – Alex Sep 16 '19 at 19:39
  • *with load balancer before them)) – Alex Sep 16 '19 at 20:16