Usin I2C to Interupt

Been programing long time with C# and Java but fairly new to Arduino.
I have an Arduino Nano that monitors 7 ultrasonic sensors. When a sensor sense a certain distance I send an communication to a Arduino Mega connected via I2C. This works fine, but if the Mega is "busy" running other code it is not going to process the data from the Nano in a timely manner.

Is there a way to make the I2C communication an Interrupt on the Mega so that when an data is sent it immediately performs some code in a method.

Hope this makes sense.

Thanks,

Is there a way to make the I2C communication an Interrupt on the Mega so that when an data is sent it immediately performs some code in a method.

I2C slave operations are always interrupt based so if your Nano sends (that means it must be an I2C master) anything to the Mega, the Mega is always interrupted and the routines you provided are called.

If that doesn't help: Provide your complete code!

Thank you for your response. I am sorry for the late reply.... I never got an email telling me there was a response so I thought know one had answered.
Thanks Again!

Another quick question along this same line:
If the slave is implementing the delay(x) command, will this prevent the interrupt from I2C until the delay has ran its course?

It does not prevent the interrupt. That's the point of interrupts.

I am sorry I should have explained better: I read on a post on another forum that if delay(x) was called on the slave and an interrupt came in, the interrupt would work but if you called a function from the interrupt it would not run until the delay was done.
Is this the case?
Thanks!

I read on a post on another forum that if delay(x) was called on the slave and an interrupt came in, the interrupt would work but if you called a function from the interrupt it would not run until the delay was done.
Is this the case?

No, this isn't the case. I guess you misunderstood the that post. The interrupt is handled disregarded if the then running code is a delay() call or something else.
The point is that interrupt service routines should be as short as possible and all lengthier tasks should not be done inside an ISR but in the standard loop().
So usually you should try to eliminate all delay() calls from your program as they are not necessary in most situations. Take a look at the BlinkWithoutDelay example to have a template of how to avoid that call.

Thank you!